Commit c653ab45 authored by Antoine Bernard's avatar Antoine Bernard

[pw_reset] hotfix: le champ userPassword n'existe pas forcément.

parent d0ac2fc7
......@@ -62,8 +62,9 @@ class MyResetTokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, user, timestamp):
# On surchage la méthode pour rechercher les informations
# dans la base LDAP
login_timestamp = (user['derniereConnexion'] or '')[0:1]
return str(user["uidNumber"][0]) + str(user['userPassword'][0])\
login_timestamp = user.get('derniereConnexion', [''])[0]
pw = user.get('userPassword', [''])[0]
return str(user["uidNumber"][0]) + str(pw)\
+ str(login_timestamp) + str(timestamp)
my_token_generator = MyResetTokenGenerator()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment