[Update] 启用ldap移动位置

pull/944/head
ibuler 2018-01-17 17:22:04 +08:00
parent a77acb7dfb
commit d08a1c3ddb
4 changed files with 6 additions and 6 deletions

View File

@ -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
)

View File

@ -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')

Binary file not shown.

View File

@ -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"