mirror of https://github.com/jumpserver/jumpserver
perf: 修复测试 smtp 的subject prefix 丢失问题
parent
e88cb71d3c
commit
29c5fd1191
|
@ -2,13 +2,14 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from smtplib import SMTPSenderRefused
|
from smtplib import SMTPSenderRefused
|
||||||
from rest_framework.views import Response, APIView
|
|
||||||
|
from django.conf import settings
|
||||||
from django.core.mail import send_mail, get_connection
|
from django.core.mail import send_mail, get_connection
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from rest_framework.views import Response, APIView
|
||||||
|
|
||||||
from common.utils import get_logger
|
from common.utils import get_logger
|
||||||
from .. import serializers
|
from .. import serializers
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
logger = get_logger(__file__)
|
logger = get_logger(__file__)
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ class MailTestingAPI(APIView):
|
||||||
# if k.startswith('EMAIL'):
|
# if k.startswith('EMAIL'):
|
||||||
# setattr(settings, k, v)
|
# setattr(settings, k, v)
|
||||||
try:
|
try:
|
||||||
subject = "Test"
|
subject = settings.EMAIL_SUBJECT_PREFIX + "Test"
|
||||||
message = "Test smtp setting"
|
message = "Test smtp setting"
|
||||||
email_from = email_from or email_host_user
|
email_from = email_from or email_host_user
|
||||||
email_recipient = email_recipient or email_from
|
email_recipient = email_recipient or email_from
|
||||||
|
|
Loading…
Reference in New Issue