if user and user['verification_key'] == unicode(request.GET['token']):
user[u'status'] = u'active'
- user[u'email_verified'] = True
+ user.email_verified = True
user[u'verification_key'] = None
user.save()
{'email': request.POST['username']})
if user:
- if user['email_verified'] and user['status'] == 'active':
+ if user.email_verified and user['status'] == 'active':
user[u'fp_verification_key'] = unicode(uuid.uuid4())
user[u'fp_token_expire'] = datetime.datetime.now() + \
datetime.timedelta(days=10)
if ((user and user['fp_verification_key'] and
user['fp_verification_key'] == unicode(formdata_token) and
datetime.datetime.now() < user['fp_token_expire']
- and user['email_verified'] and user['status'] == 'active')):
+ and user.email_verified and user['status'] == 'active')):
cp_form = auth_forms.ChangePassForm(formdata_vars)
entry.email = unicode(args.email)
entry.pw_hash = auth_lib.bcrypt_gen_password_hash(args.password)
entry['status'] = u'active'
- entry['email_verified'] = True
+ entry.email_verified = True
entry.save(validate=True)
print "User created (and email marked as verified)"
{'username': 'happygirl'})
assert new_user
assert new_user['status'] == u'needs_email_verification'
- assert new_user['email_verified'] == False
+ assert new_user.email_verified == False
## Make sure user is logged in
request = template.TEMPLATE_TEST_CONTEXT[
{'username': 'happygirl'})
assert new_user
assert new_user['status'] == u'needs_email_verification'
- assert new_user['email_verified'] == False
+ assert new_user.email_verified == False
## Verify the email activation works
template.clear_test_template_context()
{'username': 'happygirl'})
assert new_user
assert new_user['status'] == u'active'
- assert new_user['email_verified'] == True
+ assert new_user.email_verified == True
# Uniqueness checks
# -----------------