Skip to content
Snippets Groups Projects
Commit c796c97b authored by KreizerHgz's avatar KreizerHgz
Browse files

CS 63 refactored (comment)

parent 5fd7d955
No related branches found
No related tags found
No related merge requests found
......@@ -142,10 +142,6 @@ class DietList(
def get_queryset(self):
qs = Diet.objects.none()
if self.request.user:
# A diet should be visible to the requesting user if any of the following hold:
# - The diet has public visibility
# - The owner of the diet is the requesting user
# - The diet has coach visibility and the requesting user is the owner's coach
qs = Diet.objects.filter(
Q(visibility="PU")
| (Q(visibility="CO") & Q(owner__coach=self.request.user))
......
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