src/cm/notifications.py
changeset 267 526d9178e290
parent 53 3be33d57ab11
child 272 1671766692e5
equal deleted inserted replaced
266:33eb2ee6b9de 267:526d9178e290
    33         for notification in notifications:            
    33         for notification in notifications:            
    34             viewable = get_viewable_comments(FakeRequest(notification.user),
    34             viewable = get_viewable_comments(FakeRequest(notification.user),
    35                                              Comment.objects.filter(id__in = [activity.comment.id]),
    35                                              Comment.objects.filter(id__in = [activity.comment.id]),
    36                                              text=activity.text)
    36                                              text=activity.text)
    37             if viewable and \
    37             if viewable and \
    38                 ((notification.type == 'own' and activity.comment.top_comment().user == notification.user) or
    38                 ((notification.type == 'own' and activity.comment.user != notification.user and activity.comment.top_comment().user == notification.user) or
    39                  (notification.type != 'own')):
    39                  (notification.type != 'own')):
    40                 if not notification.user in allready_notified:
    40                 if not notification.user in allready_notified:
    41                     send_notification(activity, notification)
    41                     send_notification(activity, notification)
    42                     allready_notified.add(notification.user)            
    42                     allready_notified.add(notification.user)            
    43     elif activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_texts'):
    43     elif activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_texts'):