Some indentations fixes. Changed all the email=id function arguments to email=id.email().
authorPawel Solyga <Pawel.Solyga@gmail.com>
Tue, 14 Oct 2008 12:02:42 +0000
changeset 321 f17ecd21ca33
parent 320 a0a86306e7f6
child 322 6641e941ef1e
Some indentations fixes. Changed all the email=id function arguments to email=id.email(). Patch by: Pawel Solyga Review by: to-be-reviewed
app/soc/logic/site/id_user.py
app/soc/views/helper/access.py
app/soc/views/site/docs/edit.py
app/soc/views/site/home.py
app/soc/views/site/sponsor/profile.py
app/soc/views/site/user/profile.py
app/soc/views/user/profile.py
--- a/app/soc/logic/site/id_user.py	Mon Oct 13 22:32:09 2008 +0000
+++ b/app/soc/logic/site/id_user.py	Tue Oct 14 12:02:42 2008 +0000
@@ -89,7 +89,7 @@
   if not id:
     id = current_id
 
-  user = models.user.logic.getFromFields(email=id)
+  user = models.user.logic.getFromFields(email=id.email())
 
   if not user:
     # no User entity for this Google Account, and id is not the currently
--- a/app/soc/views/helper/access.py	Mon Oct 13 22:32:09 2008 +0000
+++ b/app/soc/views/helper/access.py	Tue Oct 14 12:02:42 2008 +0000
@@ -98,7 +98,7 @@
   checkIsLoggedIn(request)
 
   id = users.get_current_user()
-  user = models.user.logic.getFromFields(email=id)
+  user = models.user.logic.getFromFields(email=id.email())
 
   if user:
     return
--- a/app/soc/views/site/docs/edit.py	Mon Oct 13 22:32:09 2008 +0000
+++ b/app/soc/views/site/docs/edit.py	Tue Oct 14 12:02:42 2008 +0000
@@ -103,8 +103,8 @@
   properties['user'] = models.user.logic.getFromFields(email=email)
 
   doc = document.logic.updateOrCreateFromFields(properties,
-            partial_path=partial_path, link_name=link_name)
-
+                                                partial_path=partial_path,
+                                                link_name=link_name)
   return doc
 
 
@@ -143,7 +143,7 @@
   try:
     if path:
       doc = document.logic.getFromFields(partial_path=partial_path,
-                                                   link_name=link_name)
+                                         link_name=link_name)
   except out_of_band.ErrorResponse, error:
     # show custom 404 page when path doesn't exist in Datastore
     error.message = error.message + DEF_CREATE_NEW_DOC_MSG
--- a/app/soc/views/site/home.py	Mon Oct 13 22:32:09 2008 +0000
+++ b/app/soc/views/site/home.py	Tue Oct 14 12:02:42 2008 +0000
@@ -111,7 +111,7 @@
   context = helper.responses.getUniversalContext(request)
   
   site_settings = soc.logic.models.site_settings.logic.getFromFields(
-                                                  path=DEF_SITE_SETTINGS_PATH)
+      path=DEF_SITE_SETTINGS_PATH)
 
   if site_settings:
     context['site_settings'] = site_settings
@@ -161,7 +161,7 @@
       link_name = DEF_SITE_HOME_DOC_LINK_NAME
       partial_path=DEF_SITE_SETTINGS_PATH
       logged_in_id = users.get_current_user()
-      user = models.user.logic.getFromFields(email=logged_in_id)
+      user = models.user.logic.getFromFields(email=logged_in_id.email())
 
       properties = {
         'title': document_form.cleaned_data.get('title'),
--- a/app/soc/views/site/sponsor/profile.py	Mon Oct 13 22:32:09 2008 +0000
+++ b/app/soc/views/site/sponsor/profile.py	Tue Oct 14 12:02:42 2008 +0000
@@ -109,7 +109,7 @@
   context = helper.responses.getUniversalContext(request)
 
   logged_in_id = users.get_current_user()
-  user = models.user.logic.getFromFields(email=logged_in_id)
+  user = models.user.logic.getFromFields(email=logged_in_id.email())
   sponsor_form = None
   existing_sponsor = None
 
--- a/app/soc/views/site/user/profile.py	Mon Oct 13 22:32:09 2008 +0000
+++ b/app/soc/views/site/user/profile.py	Tue Oct 14 12:02:42 2008 +0000
@@ -378,7 +378,7 @@
   def clean_id(self):
     new_email = self.cleaned_data.get('id')
     form_id = users.User(email=new_email)
-    if models.user.logic.getFromFields(email=form_id):
+    if models.user.logic.getFromFields(email=form_id.email()):
         raise forms.ValidationError("This account is already in use.")
     return form_id
 
@@ -420,7 +420,7 @@
         'is_developer': form.cleaned_data.get('is_developer'),
       }
 
-      user = models.user.logic.updateOrCreateFromFields(properties, email=form_id)
+      user = models.user.logic.updateOrCreateFromFields(properties, email=form_id.email())
 
       if not user:
         return http.HttpResponseRedirect('/')
--- a/app/soc/views/user/profile.py	Mon Oct 13 22:32:09 2008 +0000
+++ b/app/soc/views/user/profile.py	Tue Oct 14 12:02:42 2008 +0000
@@ -147,7 +147,7 @@
           request, link_name, new_link_name, params=SUBMIT_PROFILE_SAVED_PARAMS)
   else: # request.method == 'GET'
     # try to fetch User entity corresponding to Google Account if one exists
-    user = models.user.logic.getFromFields(email=id)
+    user = models.user.logic.getFromFields(email=id.email())
 
     if user:
       # is 'Profile saved' parameter present, but referrer was not ourself?