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

Fix query

parent fc2f0f6c
No related branches found
No related tags found
1 merge request!49Resolve "Add rules and permissions"
Pipeline #3470 passed
......@@ -192,6 +192,6 @@ def has_any_object_absence(user: User) -> bool:
Predicate which builds a query with all the persons the given users is allowed to register an absence for.
"""
return get_objects_for_user(user, "core.register_absence_person", Person)\
.union(Person.objects.filter(member_of__owners=user))\
.union(Person.objects.filter(member_of__owners=user.person))\
.union(Person.objects.filter(member_of__in=get_objects_for_user(user, "core.register_absence_group", Group)))\
.exists()
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