# HG changeset patch # User raph # Date 1260524468 -3600 # Node ID 3be33d57ab114833beedadb2bac90ee93baf67f2 # Parent 9fa013909d9aa5898be396d29fbca04a806ebbc4 do not send notifications after desactivation diff -r 9fa013909d9a -r 3be33d57ab11 src/cm/notifications.py --- a/src/cm/notifications.py Fri Dec 11 10:29:11 2009 +0100 +++ b/src/cm/notifications.py Fri Dec 11 10:41:08 2009 +0100 @@ -21,7 +21,7 @@ activity = kwargs['instance'] if activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_users'): # user activity: only viewed by managers - notifications = Notification.objects.filter(text=None) + notifications = Notification.objects.filter(text=None, active=True) for notification in notifications: if notification.user: from cm.security import user_has_perm # import here! @@ -29,7 +29,7 @@ send_notification(activity, notification) allready_notified.add(notification.user) elif activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_comments'): - notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None)) + notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None), active=True) for notification in notifications: viewable = get_viewable_comments(FakeRequest(notification.user), Comment.objects.filter(id__in = [activity.comment.id]), @@ -41,7 +41,7 @@ send_notification(activity, notification) allready_notified.add(notification.user) elif activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_texts'): - notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None)) + notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None), active=True) for notification in notifications: if notification.user: from cm.security import user_has_perm # import here!