Change ldap credentials which was set to dummy during migration
This commit is contained in:
parent
b9096de386
commit
d21c5837f7
1 changed files with 9 additions and 0 deletions
|
@ -235,6 +235,15 @@ class CustomUser(AbstractBaseUser, PermissionsMixin):
|
||||||
email=self.email)
|
email=self.email)
|
||||||
self.in_ldap = True
|
self.in_ldap = True
|
||||||
self.save()
|
self.save()
|
||||||
|
else:
|
||||||
|
# User exists already in LDAP, but with a dummy credential
|
||||||
|
# We are here implies that the user has successfully
|
||||||
|
# authenticated against Django db, and a corresponding user
|
||||||
|
# exists in LDAP.
|
||||||
|
# We just update the LDAP credentials once again, assuming it
|
||||||
|
# was set to a dummy value while migrating users from Django to
|
||||||
|
# LDAP
|
||||||
|
ldap_manager.change_password(self.username, password)
|
||||||
|
|
||||||
def __str__(self): # __unicode__ on Python 2
|
def __str__(self): # __unicode__ on Python 2
|
||||||
return self.email
|
return self.email
|
||||||
|
|
Loading…
Reference in a new issue