Beispiel #1
0
def remove_group_from_inbox(group, action=None, user=None, referrer=None):
    try:
        group_inbox = GroupInbox.objects.get(group=group)
        group_inbox.delete()

        if action is GroupInboxRemoveAction.MARK_REVIEWED and user is not None:
            Activity.objects.create(
                project_id=group_inbox.group.project_id,
                group_id=group_inbox.group_id,
                type=Activity.MARK_REVIEWED,
                user=user,
            )

        if action:
            inbox_out.send_robust(
                group=group_inbox.group,
                project=group_inbox.group.project,
                user=user,
                sender="remove_group_from_inbox",
                action=action.value,
                inbox_date_added=group_inbox.date_added,
                referrer=referrer,
            )
    except GroupInbox.DoesNotExist:
        pass
Beispiel #2
0
def remove_group_from_inbox(group, action=None, user=None):
    try:
        group_inbox = GroupInbox.objects.get(group=group)
        group_inbox.delete()

        inbox_out.send_robust(
            group=group_inbox.group,
            project=group_inbox.group.project,
            user=user,
            sender="remove_group_from_inbox",
            action=action,
            inbox_date_added=group_inbox.date_added,
        )
    except GroupInbox.DoesNotExist:
        pass