Skip to content
Snippets Groups Projects
Commit 62fdc90f authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch '280-is_member_of-predicate' into 'master'

Resolve "is_member_of predicate"

Closes #280

See merge request AlekSIS/official/AlekSIS!290
parents 118d3baa 1cd97440
No related branches found
No related tags found
1 merge request!290Resolve "is_member_of predicate"
Pipeline #2377 failed
......@@ -98,6 +98,12 @@ def is_group_owner(user: User, group: Group) -> bool:
return group.owners.filter(owners=user.person).exists()
@predicate
def is_group_member(user: User, group: Group) -> bool:
"""Predicate which checks if the user is a member of the provided group."""
return user.person in group.members.all()
@predicate
def is_notification_recipient(user: User, obj: Model) -> bool:
"""Check if is a notification recipient.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment