In soc.views.models.user module fix too long line. Delete unused email variable, add missing doc and rename self method and global variable to editSelf and edit_self so it's not confused with "self" used in classes and there is no outerscope variable name overwriting anymore.
Patch by: Pawel Solyga
--- a/app/soc/views/models/user.py Mon Nov 10 22:45:17 2008 +0000
+++ b/app/soc/views/models/user.py Mon Nov 10 22:50:27 2008 +0000
@@ -19,6 +19,7 @@
__authors__ = [
'"Sverre Rabbelier" <sverre@rabbelier.nl>',
+ '"Pawel Solyga" <pawel.solyga@gmail.com>',
]
from google.appengine.api import users
@@ -83,7 +84,8 @@
new_email = form_id.email()
- if new_email != old_email and user_logic.logic.getFromFields(email=new_email):
+ if new_email != old_email \
+ and user_logic.logic.getFromFields(email=new_email):
raise forms.ValidationError("This account is already in use.")
return form_id
@@ -149,14 +151,20 @@
base.View.__init__(self, rights=rights, params=params)
- def self(self, request, page=None, params=None, **kwargs):
- """
+ def editSelf(self, request, page=None, params=None, **kwargs):
+ """Displays User self edit page for the entity specified by **kwargs.
+
+ Args:
+ request: the standard Django HTTP request object
+ page: a soc.logic.site.page.Page object which is abstraction
+ that combines a Django view with sidebar menu info
+ params: a dict with params for this View
+ kwargs: The Key Fields for the specified entity
"""
params = dicts.merge(params, {'edit_template': 'soc/user/edit_self.html'})
id = users.get_current_user()
- email = id.email()
properties = {'id': id}
entity = self._logic.getForFields(properties, unique=True)
@@ -180,4 +188,4 @@
edit = view.edit
list = view.list
public = view.public
-self = view.self
+edit_self = view.editSelf