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

Fix for_participant query

parent 53fab05f
No related branches found
No related tags found
1 merge request!353Fix some bugs
......@@ -878,7 +878,7 @@ class LessonEventQuerySet(PolymorphicQuerySet):
def for_participant(self, person: Union[int, Person]) -> "LessonEventQuerySet":
"""Get all lesson events the person participates in (including amends)."""
amended = self.filter(Q(amended_by__isnull=False) | Q(groups__members=person)).values_list(
amended = self.filter(Q(amended_by__isnull=False) & Q(groups__members=person)).values_list(
"amended_by__pk", flat=True
)
return self.filter(Q(groups__members=person) | Q(pk__in=amended)).distinct()
......
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