diff -r af360d1017df -r 25cd704fdfdf app/soc/logic/models/request.py --- a/app/soc/logic/models/request.py Fri Mar 20 11:49:12 2009 +0000 +++ b/app/soc/logic/models/request.py Fri Mar 20 14:04:57 2009 +0000 @@ -58,7 +58,7 @@ """ return ['scope_path', 'role', 'link_id'] - + def _onCreate(self, entity): """Sends out a message notifying users about the new invite/request. """ @@ -73,5 +73,24 @@ super(Logic, self)._onCreate(entity) + def _updateField(self, entity, entity_properties, name): + """Called when the fields of the request are updated. + + - Sends out a message depending on the change of status + """ + + value = entity_properties[name] + + if name == 'status' and entity.status != value: + if value == 'group_accepted': + # this is an invite + notifications.sendInviteNotification(entity) + elif value == 'new': + # this is a request + # TODO(Lennard) Create a new request message + pass + + return super(Logic, self)._updateField(entity, entity_properties, name) + logic = Logic()