prevent password reset from breaking if you have no password

If you've just been invited, or are using social auth, you have no
password set, so the reset password feature causes a crash.  This
doesn't need to happen.
This commit is contained in:
Nick Retallack
2015-04-07 16:32:28 -07:00
parent 8a14abaa1e
commit 7884d637c5
+2 -1
View File
@@ -53,7 +53,8 @@ def generate_reset_password_token(user):
:param user: The user to work with
"""
data = [str(user.id), md5(user.password)]
password_hash = md5(user.password) if user.password else None
data = [str(user.id), password_hash]
return _security.reset_serializer.dumps(data)