# HG changeset patch # User Lennard de Rijk # Date 1229180100 0 # Node ID 4c78ee183eb612692f54059d334516882f7ab23f # Parent c70d56182ce26b6efa3f293e697db5c7aa31ebe9 Notification property has_been_read changed into unread Due to comments on r1309. Patch By: Lennard de Rijk diff -r c70d56182ce2 -r 4c78ee183eb6 app/soc/models/notification.py --- a/app/soc/models/notification.py Sat Dec 13 13:28:01 2008 +0000 +++ b/app/soc/models/notification.py Sat Dec 13 14:55:00 2008 +0000 @@ -53,6 +53,6 @@ created_on = db.DateTimeProperty(auto_now_add=True, verbose_name=ugettext_lazy('Created On')) - # boolean property that marks if the notification has been read - has_been_read = db.BooleanProperty(default=False, - verbose_name=ugettext_lazy('Read')) + # boolean property that marks if the notification is unread + unread = db.BooleanProperty(default=True, + verbose_name=ugettext_lazy('Unread')) diff -r c70d56182ce2 -r 4c78ee183eb6 app/soc/views/models/notification.py --- a/app/soc/views/models/notification.py Sat Dec 13 13:28:01 2008 +0000 +++ b/app/soc/views/models/notification.py Sat Dec 13 14:55:00 2008 +0000 @@ -63,7 +63,7 @@ model = notification_model.Notification # exclude the necessary fields from the form - exclude = ['link_id', 'scope', 'scope_path', 'from_user', 'has_been_read'] + exclude = ['link_id', 'scope', 'scope_path', 'from_user', 'unread'] def clean_to_user(self): """Check if the to_user field has been filled in correctly. @@ -185,13 +185,14 @@ # if the user viewing is the user for which this notification is meant # and the notification has not been read yet - if not entity.has_been_read: + if entity.unread: # get the current user user = user_logic.logic.getForCurrentAccount() - + + # if the message is meant for the user that is reading it if entity.scope.key() == user.key(): # mark the entity as read - self._logic.updateModelProperties(entity, {'has_been_read' : True} ) + self._logic.updateModelProperties(entity, {'unread' : False} ) context['entity_type_url'] = self._params['url_name'] context['entity_suffix'] = self._logic.getKeySuffix(entity)