@classmethod
def get_repo_notifications(cls, repository_id, event=None):
    """Returns a queryset with the notifications for a given repository
        and event.

        :param repository_id: The id of the repository that sent an event.
        :param event: The event that will trigger notifications."""
    if event:
        events_kw = {'_events': event}
    else:
        events_kw = {'_events': []}
    return cls.objects.filter(repository_id=repository_id, **events_kw)
