Dictionaries need String values for keys
authorSverre Rabbelier <srabbelier@gmail.com>
Sun, 12 Oct 2008 18:40:32 +0000
changeset 311 a2121c1143b2
parent 310 0386d634ad9f
child 312 3488234b329f
Dictionaries need String values for keys The cleanup patch earlier mistakenly used raw names as keys to the dictionary (such as one would do in a function call). This fixes that mistake. Patch by: Sverre Rabbelier Reviewed by: to-be-reviewed
app/soc/views/site/home.py
app/soc/views/site/user/profile.py
app/soc/views/user/profile.py
--- a/app/soc/views/site/home.py	Sun Oct 12 18:32:43 2008 +0000
+++ b/app/soc/views/site/home.py	Sun Oct 12 18:40:32 2008 +0000
@@ -158,14 +158,14 @@
       user = models.user.logic.getFromFields(email=logged_in_id)
 
       properties = {
-        title : document_form.cleaned_data.get('title'),
-        short_name : document_form.cleaned_data.get('short_name'),
-        abstract : document_form.cleaned_data.get('abstract'),
-        content : document_form.cleaned_data.get('content'),
-        link_name : link_name,
-        partial_path : partial_path,
-        id : logged_in_id,
-        user : user,
+        'title' : document_form.cleaned_data.get('title'),
+        'short_name' : document_form.cleaned_data.get('short_name'),
+        'abstract' : document_form.cleaned_data.get('abstract'),
+        'content' : document_form.cleaned_data.get('content'),
+        'link_name' : link_name,
+        'partial_path' : partial_path,
+        'id' : logged_in_id,
+        'user' : user,
       }
 
       site_doc = document.logic.updateOrCreateFromFields(
--- a/app/soc/views/site/user/profile.py	Sun Oct 12 18:32:43 2008 +0000
+++ b/app/soc/views/site/user/profile.py	Sun Oct 12 18:40:32 2008 +0000
@@ -414,10 +414,10 @@
       link_name = form.cleaned_data.get('link_name')
 
       properties = {
-        id : form_id,
-        link_name : link_name,
-        nick_name : form.cleaned_data.get('nick_name'),
-        is_developer : form.cleaned_data.get('is_developer'),
+        'id' : form_id,
+        'link_name' : link_name,
+        'nick_name' : form.cleaned_data.get('nick_name'),
+        'is_developer' : form.cleaned_data.get('is_developer'),
       }
 
       user = models.user.logic.updateOrCreateFromFields(properties, email=form_id)
--- a/app/soc/views/user/profile.py	Sun Oct 12 18:32:43 2008 +0000
+++ b/app/soc/views/user/profile.py	Sun Oct 12 18:40:32 2008 +0000
@@ -133,9 +133,9 @@
     if form.is_valid():
       new_link_name = form.cleaned_data.get('link_name')
       properties = {
-        link_name : new_link_name,
-        nick_name : form.cleaned_data.get("nick_name"),
-        id : id,
+        'link_name' : new_link_name,
+        'nick_name' : form.cleaned_data.get("nick_name"),
+        'id' : id,
       }
 
       user = models.user.logic.updateOrCreateFromFields(properties, email=id.email())