Skip to content

Commit

Permalink
no membership notifications for single_user_groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Glatthard committed Aug 6, 2015
1 parent 7743f39 commit 5cc44f0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ipynbsrv/core/signals/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ def create_member_added_group_notification(sender, group, user, **kwargs):
Create a group notification if a member gets added.
"""
if group is not None and user is not None:
notification = Notification(
message='User %s is now a member of this group.' % user,
notification_type=Notification.GROUP,
group=group
)
notification.save()
notification.receiver_groups.add(group)
# check if group is dedicated user group
if not group.is_single_user_group:
notification = Notification(
message='User %s is now a member of this group.' % user,
notification_type=Notification.GROUP,
group=group
)
notification.save()
notification.receiver_groups.add(group)


@receiver(collaboration_group_member_removed)
Expand Down

0 comments on commit 5cc44f0

Please sign in to comment.