aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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