diff --git a/apps/common/forms.py b/apps/common/forms.py index 073bb671f..6b83c54cc 100644 --- a/apps/common/forms.py +++ b/apps/common/forms.py @@ -72,9 +72,6 @@ class BasicSettingForm(BaseForm): max_length=1024, label=_("Email Subject Prefix"), initial="[Jumpserver] " ) - AUTH_LDAP = forms.BooleanField( - label=_("Enable LDAP Auth"), initial=False, required=False - ) class EmailSettingForm(BaseForm): @@ -129,3 +126,6 @@ class LDAPSettingForm(BaseForm): AUTH_LDAP_START_TLS = forms.BooleanField( label=_("Use SSL"), initial=False, required=False ) + AUTH_LDAP = forms.BooleanField( + label=_("Enable LDAP Auth"), initial=False, required=False + ) diff --git a/apps/common/views.py b/apps/common/views.py index 4135ca82c..43b249cee 100644 --- a/apps/common/views.py +++ b/apps/common/views.py @@ -25,8 +25,6 @@ class BasicSettingView(AdminUserRequiredMixin, TemplateView): form = self.form_class(request.POST) if form.is_valid(): form.save() - if "AUTH_LDAP" in form.cleaned_data: - ldap_auth_enable.send(form.cleaned_data["AUTH_LDAP"]) msg = _("Update setting successfully, please restart program") messages.success(request, msg) return redirect('settings:basic-setting') @@ -79,6 +77,8 @@ class LDAPSettingView(AdminUserRequiredMixin, TemplateView): form = self.form_class(request.POST) if form.is_valid(): form.save() + if "AUTH_LDAP" in form.cleaned_data: + ldap_auth_enable.send(form.cleaned_data["AUTH_LDAP"]) msg = _("Update setting successfully, please restart program") messages.success(request, msg) return redirect('settings:ldap-setting') diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 3d866a742..e11f9f556 100644 Binary files a/apps/locale/zh/LC_MESSAGES/django.mo and b/apps/locale/zh/LC_MESSAGES/django.mo differ diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 55e035bfe..50aec9767 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -1311,7 +1311,7 @@ msgstr "Email主题前缀" #: common/forms.py:76 msgid "Enable LDAP Auth" -msgstr "LDAP认证" +msgstr "开启LDAP认证" #: common/forms.py:82 msgid "SMTP host"