Send out a Notification upon creation of a new Request entity.
authorLennard de Rijk <ljvderijk@gmail.com>
Fri, 24 Jul 2009 21:00:04 +0200
changeset 2678 a525a55833f1
parent 2677 7df4d0fcbb80
child 2679 0ede2f3adbc1
Send out a Notification upon creation of a new Request entity. The receivers are specified by the corresponding Role logic this Role Request is for. Currently Organization and Club Administrators will receive "new request" messages about respectively Mentor and Club Membership requests. Fixes Issue 442.
app/soc/logic/models/request.py
app/soc/views/models/role.py
--- a/app/soc/logic/models/request.py	Fri Jul 24 20:57:53 2009 +0200
+++ b/app/soc/logic/models/request.py	Fri Jul 24 21:00:04 2009 +0200
@@ -68,8 +68,7 @@
       notifications.sendInviteNotification(entity)
     elif entity.status == 'new':
       # this is a request
-      # TODO(Lennard) Create a new request message
-      pass
+      notifications.sendNewRequestNotification(entity)
 
     super(Logic, self)._onCreate(entity)
 
@@ -87,8 +86,7 @@
         notifications.sendInviteNotification(entity)
       elif value == 'new':
         # this is a request
-        # TODO(Lennard) Create a new request message
-        pass
+        notifications.sendNewRequestNotification(entity)
 
     return super(Logic, self)._updateField(entity, entity_properties, name)
 
--- a/app/soc/views/models/role.py	Fri Jul 24 20:57:53 2009 +0200
+++ b/app/soc/views/models/role.py	Fri Jul 24 21:00:04 2009 +0200
@@ -558,9 +558,6 @@
     # create the request entity
     request_logic.logic.updateOrCreateFromKeyName(request_fields, key_name)
 
-    # TODO(ljvderijk): send out a message to alert the users 
-    # able to process this request
-
     # redirect to requests overview
     return http.HttpResponseRedirect('/user/requests')