Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
authorLennard de Rijk <ljvderijk@gmail.com>
Fri, 24 Jul 2009 19:59:26 +0200
changeset 2672 7bc9d3b962af
parent 2671 2eaacbbdb168
child 2673 cecb3a669527
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications. This method returns a list of all the Role Logics that can be used to query who should receive a notification when a new Role Request arrives.
app/soc/logic/models/club_member.py
app/soc/logic/models/mentor.py
app/soc/logic/models/role.py
--- a/app/soc/logic/models/club_member.py	Fri Jul 24 15:23:45 2009 +0200
+++ b/app/soc/logic/models/club_member.py	Fri Jul 24 19:59:26 2009 +0200
@@ -43,5 +43,13 @@
                                 base_model=base_model, scope_logic=scope_logic,
                                 disallow_last_resign=disallow_last_resign)
 
+  def getRoleLogicsToNotifyUponeNewRequest(self):
+    """Returns a list with ClubAdmin logic which can be used to notify all
+    appropriate Club Admins.
+    """
+
+    from soc.logic.models.club_admin import logic as club_admin_logic
+
+    return [club_admin_logic]
 
 logic = Logic()
--- a/app/soc/logic/models/mentor.py	Fri Jul 24 15:23:45 2009 +0200
+++ b/app/soc/logic/models/mentor.py	Fri Jul 24 19:59:26 2009 +0200
@@ -116,5 +116,13 @@
 
     return super(Logic, self)._updateField(entity, entity_properties, name)
 
+  def getRoleLogicsToNotifyUponeNewRequest(self):
+    """Returns a list with OrgAdmin logic which can be used to notify all
+    appropriate Organization Admins.
+    """
+
+    from soc.logic.models.org_admin import logic as org_admin_logic
+
+    return [org_admin_logic]
 
 logic = Logic()
--- a/app/soc/logic/models/role.py	Fri Jul 24 15:23:45 2009 +0200
+++ b/app/soc/logic/models/role.py	Fri Jul 24 19:59:26 2009 +0200
@@ -139,4 +139,15 @@
     # resignation is possible
     return None
 
+  def getRoleLogicsToNotifyUponeNewRequest(self):
+    """Returns a list with subclasses of Role Logic which should be notified
+    when a new request to obtain this Role arrives.
+
+    Returns:
+      A list with all Role Logics to notify
+    """
+
+    return []
+
+
 logic = Logic()