diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-14 19:24:15 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-12-05 21:08:58 +0100 |
commit | 2d540fed8b511c76819a836da3d62875d20b6547 (patch) | |
tree | 17c4719ef1145109d12bfa6ec9138f60162f4808 /mediagoblin/auth | |
parent | dc39e4555c9e104ae9d7b38f231a848fe106d1a0 (diff) | |
download | mediagoblin-2d540fed8b511c76819a836da3d62875d20b6547.tar.lz mediagoblin-2d540fed8b511c76819a836da3d62875d20b6547.tar.xz mediagoblin-2d540fed8b511c76819a836da3d62875d20b6547.zip |
Dot-Notation for Users.fp_token_expire
Diffstat (limited to 'mediagoblin/auth')
-rw-r--r-- | mediagoblin/auth/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 633ceef4..919aa3cd 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -251,7 +251,7 @@ def forgot_password(request): if user: if user.email_verified and user.status == 'active': user.fp_verification_key = unicode(uuid.uuid4()) - user[u'fp_token_expire'] = datetime.datetime.now() + \ + user.fp_token_expire = datetime.datetime.now() + \ datetime.timedelta(days=10) user.save() @@ -303,7 +303,7 @@ def verify_forgot_password(request): # check if we have a real user and correct token if ((user and user.fp_verification_key and user.fp_verification_key == unicode(formdata_token) and - datetime.datetime.now() < user['fp_token_expire'] + datetime.datetime.now() < user.fp_token_expire and user.email_verified and user.status == 'active')): cp_form = auth_forms.ChangePassForm(formdata_vars) @@ -312,7 +312,7 @@ def verify_forgot_password(request): user.pw_hash = auth_lib.bcrypt_gen_password_hash( request.POST['password']) user.fp_verification_key = None - user[u'fp_token_expire'] = None + user.fp_token_expire = None user.save() return redirect(request, 'mediagoblin.auth.fp_changed_success') |