Skip to content
Snippets Groups Projects

Add view for ToS

Merged Tom Teichler requested to merge tos into master
@@ -38,3 +38,9 @@ def is_organiser(user: User, obj: Union[Event, EventRegistration]) -> bool:
def is_event_published(user: User, obj: EventRegistration) -> bool:
"""Predicate which checks if the event is published."""
return obj.published
@predicate
def is_participant(user: User, obj: Event) -> bool:
"""Predicate which checks if the user is member of the event."""
return user.person in obj.linked_group.members.all()
Loading