aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-11-14 18:54:52 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-05 21:08:57 +0100
commit4facc7a0a21a57023f0d3707f1a3483ca7a560c8 (patch)
tree1f3dcc15514bd21b4ca696ee5577f4e5110cb151 /mediagoblin
parent9047b254f340c16f33183f0d6d68e6c4a5a3c8de (diff)
downloadmediagoblin-4facc7a0a21a57023f0d3707f1a3483ca7a560c8.tar.lz
mediagoblin-4facc7a0a21a57023f0d3707f1a3483ca7a560c8.tar.xz
mediagoblin-4facc7a0a21a57023f0d3707f1a3483ca7a560c8.zip
Dot-Notation for Users.email_verified
Diffstat (limited to 'mediagoblin')
-rw-r--r--mediagoblin/auth/views.py6
-rw-r--r--mediagoblin/gmg_commands/users.py2
-rw-r--r--mediagoblin/tests/test_auth.py6
3 files changed, 7 insertions, 7 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index 63bf9a91..2d29d0a5 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -168,7 +168,7 @@ def verify_email(request):
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()
@@ -249,7 +249,7 @@ def forgot_password(request):
{'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)
@@ -304,7 +304,7 @@ def verify_forgot_password(request):
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)
diff --git a/mediagoblin/gmg_commands/users.py b/mediagoblin/gmg_commands/users.py
index 6084f9d7..88895661 100644
--- a/mediagoblin/gmg_commands/users.py
+++ b/mediagoblin/gmg_commands/users.py
@@ -54,7 +54,7 @@ def adduser(args):
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)"
diff --git a/mediagoblin/tests/test_auth.py b/mediagoblin/tests/test_auth.py
index 2faf0f25..ad9a5bca 100644
--- a/mediagoblin/tests/test_auth.py
+++ b/mediagoblin/tests/test_auth.py
@@ -163,7 +163,7 @@ def test_register_views(test_app):
{'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[
@@ -203,7 +203,7 @@ def test_register_views(test_app):
{'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()
@@ -217,7 +217,7 @@ def test_register_views(test_app):
{'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
# -----------------