Added verbose role name to the request model.
authorLennard de Rijk <ljvderijk@gmail.com>
Fri, 23 Jan 2009 11:34:58 +0000
changeset 915 27c656c01591
parent 914 6ec8dd2a73b3
child 916 f18c0a56da8b
Added verbose role name to the request model. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/logic/helper/notifications.py
app/soc/models/request.py
--- a/app/soc/logic/helper/notifications.py	Fri Jan 23 11:32:53 2009 +0000
+++ b/app/soc/logic/helper/notifications.py	Fri Jan 23 11:34:58 2009 +0000
@@ -45,7 +45,7 @@
   "You have received a new Notification.")
 
 DEF_INVITATION_MSG_FMT = ugettext_lazy(
-    "Invitation to become a %(role)s for %(group)s.")
+    "Invitation to become a %(role_verbose)s for %(group)s.")
 
 DEF_NEW_CLUB_MSG_FMT = ugettext_lazy(
     "Your club application for %(name)s has been accepted.")
@@ -70,17 +70,17 @@
 
   invitation_url = "http://%(host)s%(index)s" % {
       'host' : os.environ['HTTP_HOST'],
-      'index': redirects.inviteAcceptedRedirect(entity, None),
+      'index': redirects.inviteProcessRedirect(entity, None),
       }
 
   message_properties = {
-      'role': entity.role,
+      'role_verbose' : entity.role_verbose,
       'group': entity.scope.name,
       'invitation_url': invitation_url,
       }
 
   subject = DEF_INVITATION_MSG_FMT % {
-      'role' : entity.role,
+      'role_verbose' : entity.role_verbose,
       'group' : entity.scope.name
       }
 
--- a/app/soc/models/request.py	Fri Jan 23 11:32:53 2009 +0000
+++ b/app/soc/models/request.py	Fri Jan 23 11:34:58 2009 +0000
@@ -33,14 +33,22 @@
   """A request is made to allow a person to create a new Role entity.
   """
 
-  role = db.StringProperty()
+  role = db.StringProperty(required=True)
   role.help_text = ugettext_lazy(
       'This should be the type of the role that is requested')
+  
+  role_verbose = db.StringProperty(required=True)
+  role_verbose.help_text = ugettext_lazy(
+      'This should be the verbose name of the role that is in this request')
 
-  group_accepted = db.BooleanProperty()
+  group_accepted = db.BooleanProperty(required=True, default=False)
   group_accepted.help_text = ugettext_lazy(
       'Field used to indicate whether a request has been accepted by the group')
 
-  user_accepted = db.BooleanProperty()
+  user_accepted = db.BooleanProperty(required=True, default=False)
   user_accepted.help_text = ugettext_lazy(
       'Field used to indicate that a request has been accepted by the user')
+  
+  completed = db.BooleanProperty(required=True, default=False)
+  completed.help_text = ugettext_lazy(
+      'Field used to indiicate that a request has been completed and should be archived')