Calling getForCurrentAccount where necessary.
Also fixed whitespace error in soc/views/models/user_self.py
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/helper/responses.py Mon Feb 02 15:00:43 2009 +0000
+++ b/app/soc/views/helper/responses.py Mon Feb 02 15:04:04 2009 +0000
@@ -103,8 +103,7 @@
context['request'] = request
if account:
- user = soc.logic.models.user.logic.getForFields(
- {'account': account}, unique=True)
+ user = soc.logic.models.user.logic.getForCurrentAccount()
is_admin = accounts.isDeveloper(account=account)
context['account'] = account
--- a/app/soc/views/models/document.py Mon Feb 02 15:00:43 2009 +0000
+++ b/app/soc/views/models/document.py Mon Feb 02 15:04:04 2009 +0000
@@ -114,8 +114,7 @@
"""See base.View._editPost().
"""
- account = users.get_current_user()
- user = user_logic.getForFields({'account': account}, unique=True)
+ user = user_logic.getForCurrentAccount()
if not entity:
fields['author'] = user
--- a/app/soc/views/models/request.py Mon Feb 02 15:00:43 2009 +0000
+++ b/app/soc/views/models/request.py Mon Feb 02 15:04:04 2009 +0000
@@ -194,8 +194,7 @@
"""
# get the current user
- properties = {'account': users.get_current_user()}
- user_entity = user_logic.logic.getForFields(properties, unique=True)
+ user_entity = user_logic.logic.getForCurrentAccount()
# construct the Unhandled Invites list
--- a/app/soc/views/models/user_self.py Mon Feb 02 15:00:43 2009 +0000
+++ b/app/soc/views/models/user_self.py Mon Feb 02 15:04:04 2009 +0000
@@ -120,9 +120,9 @@
page_name = ugettext("List of your roles")
patterns += [(r'^%(url_name)s/(?P<access_type>roles)$',
'soc.views.models.request.list_self', page_name)]
-
+
new_params['django_patterns_defaults'] = patterns
-
+
params = dicts.merge(params, new_params)
super(View, self).__init__(params=params)