src/cm/notifications.py
changeset 273 05d59fd34d00
parent 272 1671766692e5
child 564 dc415eb33a3f
equal deleted inserted replaced
272:1671766692e5 273:05d59fd34d00
    17 
    17 
    18 def notify(sender, **kwargs):
    18 def notify(sender, **kwargs):
    19     from cm.security import get_viewable_comments, has_perm
    19     from cm.security import get_viewable_comments, has_perm
    20     allready_notified = set() # avoid sending multiple notifications to same user
    20     allready_notified = set() # avoid sending multiple notifications to same user
    21     
    21     
    22     #import pdb;pdb.set_trace()
       
    23     activity = kwargs['instance']
    22     activity = kwargs['instance']
    24     if activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_users'): # user activity: only viewed by managers
    23     if activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_users'): # user activity: only viewed by managers
    25         notifications = Notification.objects.filter(text=None, active=True).exclude(type='own')
    24         notifications = Notification.objects.filter(text=None, active=True).exclude(type='own')
    26         for notification in notifications:
    25         for notification in notifications:
    27             if notification.user:
    26             if notification.user: