aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-11-14 17:22:33 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-05 21:08:57 +0100
commit809cbfc5ab3c999f357c0b4e7b6c89e8a36dc6d2 (patch)
tree5c0c41e4b006a3dbdd6d0a926f4b81a73e91a577
parent5a4e3ff1e2a0f2ed451bc191c1d44bcd694b8e75 (diff)
downloadmediagoblin-809cbfc5ab3c999f357c0b4e7b6c89e8a36dc6d2.tar.lz
mediagoblin-809cbfc5ab3c999f357c0b4e7b6c89e8a36dc6d2.tar.xz
mediagoblin-809cbfc5ab3c999f357c0b4e7b6c89e8a36dc6d2.zip
Dot-Notation for Users.email
-rw-r--r--mediagoblin/auth/lib.py4
-rw-r--r--mediagoblin/auth/views.py2
-rw-r--r--mediagoblin/gmg_commands/users.py2
-rw-r--r--mediagoblin/tests/test_tests.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/mediagoblin/auth/lib.py b/mediagoblin/auth/lib.py
index ee1ce12d..24992094 100644
--- a/mediagoblin/auth/lib.py
+++ b/mediagoblin/auth/lib.py
@@ -115,7 +115,7 @@ def send_verification_email(user, request):
# TODO: There is no error handling in place
send_email(
mg_globals.app_config['email_sender_address'],
- [user['email']],
+ [user.email],
# TODO
# Due to the distributed nature of GNU MediaGoblin, we should
# find a way to send some additional information about the
@@ -150,6 +150,6 @@ def send_fp_verification_email(user, request):
# TODO: There is no error handling in place
send_email(
mg_globals.app_config['email_sender_address'],
- [user['email']],
+ [user.email],
'GNU MediaGoblin - Change forgotten password!',
rendered_email)
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index dab95b17..f8e84285 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -81,7 +81,7 @@ def register(request):
# Create the user
user = request.db.User()
user.username = username
- user['email'] = email
+ user.email = email
user['pw_hash'] = auth_lib.bcrypt_gen_password_hash(
request.POST['password'])
user.save(validate=True)
diff --git a/mediagoblin/gmg_commands/users.py b/mediagoblin/gmg_commands/users.py
index e8426272..04d88e23 100644
--- a/mediagoblin/gmg_commands/users.py
+++ b/mediagoblin/gmg_commands/users.py
@@ -51,7 +51,7 @@ def adduser(args):
# Create the user
entry = db.User()
entry.username = unicode(args.username.lower())
- entry['email'] = unicode(args.email)
+ entry.email = unicode(args.email)
entry['pw_hash'] = auth_lib.bcrypt_gen_password_hash(args.password)
entry['status'] = u'active'
entry['email_verified'] = True
diff --git a/mediagoblin/tests/test_tests.py b/mediagoblin/tests/test_tests.py
index 27098e05..b3a5c2fa 100644
--- a/mediagoblin/tests/test_tests.py
+++ b/mediagoblin/tests/test_tests.py
@@ -28,7 +28,7 @@ def test_get_test_app_wipes_db():
new_user = mg_globals.database.User()
new_user.username = u'lolcat'
- new_user['email'] = u'lol@cats.example.org'
+ new_user.email = u'lol@cats.example.org'
new_user['pw_hash'] = u'pretend_this_is_a_hash'
new_user.save()
assert mg_globals.database.User.find().count() == 1