Dot-Notation: Some random places
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 25 Dec 2011 19:04:41 +0000 (20:04 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Wed, 11 Jan 2012 10:42:26 +0000 (11:42 +0100)
mediagoblin/auth/views.py
mediagoblin/edit/views.py

index 88dc40ad016318d8d980ac8f99b86d725b541276..c04a49a73140b3ebaa2ae338fab064ff71ee28b6 100644 (file)
@@ -205,7 +205,7 @@ def resend_activation(request):
         
         return redirect(request, 'mediagoblin.auth.login')
 
-    if request.user["email_verified"]:
+    if request.user.email_verified:
         messages.add_message(
             request,
             messages.ERROR,
index bae85c5d3a8a529b98514c4d994b08fb5b9d3ece..ec748028300c17a175ff9e6227ae7dfd7549ecc1 100644 (file)
@@ -46,7 +46,7 @@ def edit_media(request, media):
         title=media.title,
         slug=media.slug,
         description=media.description,
-        tags=media_tags_as_string(media['tags']))
+        tags=media_tags_as_string(media.tags))
 
     form = forms.EditForm(
         request.POST,
@@ -165,7 +165,7 @@ def edit_profile(request):
         user.url = unicode(request.POST['url'])
         user.bio = unicode(request.POST['bio'])
 
-        user.bio_html = cleaned_markdown_conversion(user['bio'])
+        user.bio_html = cleaned_markdown_conversion(user.bio)
 
         user.save()
 
@@ -193,7 +193,7 @@ def edit_account(request):
     if request.method == 'POST' and form.validate():
         password_matches = auth_lib.bcrypt_check_password(
             request.POST['old_password'],
-            user['pw_hash'])
+            user.pw_hash)
 
         if (request.POST['old_password'] or request.POST['new_password']) and not \
                 password_matches:
@@ -206,7 +206,7 @@ def edit_account(request):
                  'form': form})
 
         if password_matches:
-            user['pw_hash'] = auth_lib.bcrypt_gen_password_hash(
+            user.pw_hash = auth_lib.bcrypt_gen_password_hash(
                 request.POST['new_password'])
 
         user.save()
@@ -216,7 +216,7 @@ def edit_account(request):
                              _("Account settings saved"))
         return redirect(request,
                        'mediagoblin.user_pages.user_home',
-                        user=user['username'])
+                        user=user.username)
 
     return render_to_response(
         request,