app/soc/views/models/notification.py
changeset 2748 7fbc98f3adde
parent 2361 40b0c25a5793
equal deleted inserted replaced
2747:915fe7338a72 2748:7fbc98f3adde
   186     # if the user viewing is the user for which this notification is meant
   186     # if the user viewing is the user for which this notification is meant
   187     # and the notification has not been read yet
   187     # and the notification has not been read yet
   188     if entity.unread:
   188     if entity.unread:
   189       # get the current user
   189       # get the current user
   190       user = user_logic.getForCurrentAccount()
   190       user = user_logic.getForCurrentAccount()
   191       
   191 
   192       # if the message is meant for the user that is reading it
   192       # if the message is meant for the user that is reading it
   193       # pylint: disable-msg=E1103
   193       # pylint: disable-msg=E1103
   194       if entity.scope.key() == user.key():
   194       if entity.scope.key() == user.key():
   195         # mark the entity as read
   195         # mark the entity as read
   196         self._logic.updateEntityProperties(entity, {'unread' : False} )
   196         self._logic.updateEntityProperties(entity, {'unread' : False} )
   197 
   197 
   198     context['entity_type_url'] = self._params['url_name']
   198     context['entity_type_url'] = self._params['url_name']
   199     context['entity_suffix'] = entity.key().id_or_name() if entity else None
   199     context['entity_suffix'] = entity.key().id_or_name() if entity else None
       
   200     context['page_name'] = 'Notification - %s' %(entity.subject)
   200 
   201 
   201     return True
   202     return True
   202 
   203 
   203 
   204 
   204 view = View()
   205 view = View()