Dot-Notation for Users.fp_token_expire

This commit is contained in:
Elrond
2011-11-14 19:24:15 +01:00
parent dc39e4555c
commit 2d540fed8b
2 changed files with 7 additions and 7 deletions

View File

@@ -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')