Dot-Notation for Users.email
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 14 Nov 2011 16:22:33 +0000 (17:22 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 5 Dec 2011 20:08:57 +0000 (21:08 +0100)
mediagoblin/auth/lib.py
mediagoblin/auth/views.py
mediagoblin/gmg_commands/users.py
mediagoblin/tests/test_tests.py

index ee1ce12db3bf1c5e7175e15b8b07fdd201a130ad..24992094e6f79641fe526d91f1aa2b46cb945c4d 100644 (file)
@@ -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)
index dab95b178a09e3d5aa94e08374601aadb984e0f9..f8e842850857992be636acdf892540f02c96fb47 100644 (file)
@@ -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)
index e8426272a52f2c180c1e7c96a2bba9c3fbc57f16..04d88e23d15fdd2e4802f3f4c65fab849c708be7 100644 (file)
@@ -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
index 27098e05153561945f300c9ef9a6a08fad873d61..b3a5c2fa6a5106bb2ad810f24173f0dd3e034fd6 100644 (file)
@@ -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