Set in_ldap even when resetting dummy credential
This commit is contained in:
parent
b076debfee
commit
f539967a22
1 changed files with 2 additions and 2 deletions
|
@ -233,8 +233,6 @@ class CustomUser(AbstractBaseUser, PermissionsMixin):
|
|||
ldap_manager.create_user(self.username, password=password,
|
||||
firstname=first_name, lastname=last_name,
|
||||
email=self.email)
|
||||
self.in_ldap = True
|
||||
self.save()
|
||||
else:
|
||||
# User exists already in LDAP, but with a dummy credential
|
||||
# We are here implies that the user has successfully
|
||||
|
@ -244,6 +242,8 @@ class CustomUser(AbstractBaseUser, PermissionsMixin):
|
|||
# was set to a dummy value while migrating users from Django to
|
||||
# LDAP
|
||||
ldap_manager.change_password(self.username, password)
|
||||
self.in_ldap = True
|
||||
self.save()
|
||||
|
||||
def __str__(self): # __unicode__ on Python 2
|
||||
return self.email
|
||||
|
|
Loading…
Reference in a new issue