Skip to content

Commit

Permalink
[bugfix] 修复非ldap配置时的一个小bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomaoxue committed Apr 18, 2018
1 parent 111b303 commit d6cf422
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ def clean_confirm_password(self):
return confirm_password

def save(self):
ldap_tool = LDAPTool()
username = self.instance.username
password = self.cleaned_data['new_password']
self.instance.set_password(password)
self.instance.save()
# ldap用户
if settings.AUTH_LDAP and self.instance.is_ldap_user:
ldap_tool = LDAPTool()
status = ldap_tool.ldap_update_password(username, new_password=password)
if status:
return self.instance
Expand Down

0 comments on commit d6cf422

Please sign in to comment.