app/soc/views/site/user/profile.py
changeset 365 74dec172944e
parent 361 465e4df617de
child 374 9363b9dc2983
--- a/app/soc/views/site/user/profile.py	Thu Oct 16 23:26:58 2008 +0000
+++ b/app/soc/views/site/user/profile.py	Thu Oct 16 23:31:57 2008 +0000
@@ -35,6 +35,7 @@
 from soc.views import simple
 from soc.views import helper
 from soc.views.helper import access
+from soc.views.helper import decorators
 from soc.views.user import profile
 
 import soc.logic
@@ -94,6 +95,7 @@
 
 DEF_SITE_USER_PROFILE_LOOKUP_TMPL = 'soc/site/user/profile/lookup.html'
 
+@decorators.view
 def lookup(request, page=None, template=DEF_SITE_USER_PROFILE_LOOKUP_TMPL):
   """View for a Developer to look up a User Model entity.
 
@@ -250,7 +252,9 @@
                           ' <a href="/site/user/profile">Create ' \
                           'a New User</a> page.'
 
-def edit(request, page=None, link_name=None, template=DEF_SITE_USER_PROFILE_EDIT_TMPL):
+@decorators.view
+def edit(request, page=None, link_name=None,
+         template=DEF_SITE_USER_PROFILE_EDIT_TMPL):
   """View for a Developer to modify the properties of a User Model entity.
 
   Args:
@@ -301,8 +305,6 @@
       
       user = models.user.logic.updateOrCreateFromKeyName(properties, key_name)
 
-      #raise forms.ValidationError("lesseee: " + new_link_name + " " +  user.link_name)
-
       if not user:
         return http.HttpResponseRedirect('/')
         
@@ -401,6 +403,7 @@
 
 DEF_SITE_CREATE_USER_PROFILE_TMPL = 'soc/site/user/profile/edit.html'
 
+@decorators.view
 def create(request, page=None, template=DEF_SITE_CREATE_USER_PROFILE_TMPL):
   """View for a Developer to create a new User Model entity.
 
@@ -438,7 +441,8 @@
         'is_developer': form.cleaned_data.get('is_developer'),
       }
 
-      user = models.user.logic.updateOrCreateFromFields(properties, email=form_id.email())
+      user = models.user.logic.updateOrCreateFromFields(properties, 
+                                                        email=form_id.email())
 
       if not user:
         return http.HttpResponseRedirect('/')
@@ -454,4 +458,4 @@
 
   context['form'] = form
 
-  return helper.responses.respond(request, template, context)
+  return helper.responses.respond(request, template, context)
\ No newline at end of file