# HG changeset patch # User Lennard de Rijk # Date 1248458366 -7200 # Node ID 7bc9d3b962af901e3c47af54c15f48baa061b21e # Parent 2eaacbbdb1685ae630b0551f288c49887a7316c0 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. diff -r 2eaacbbdb168 -r 7bc9d3b962af app/soc/logic/models/club_member.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() diff -r 2eaacbbdb168 -r 7bc9d3b962af app/soc/logic/models/mentor.py --- 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() diff -r 2eaacbbdb168 -r 7bc9d3b962af app/soc/logic/models/role.py --- 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()