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

Reformat

parent 2e30e26f
No related branches found
No related tags found
1 merge request!350Resolve "Group types that are managed by some app (e.g. cursus' "school class") can't be selected as timetable group type"
Pipeline #186601 passed with warnings
......@@ -878,12 +878,10 @@ 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_by__pk", flat=True)
return self.filter(
Q(groups__members=person) | Q(pk__in=amended)
).distinct()
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()
def for_group(self, group: Union[int, Group]) -> "LessonEventQuerySet":
"""Get all lesson events for a certain group (including amends/as parent group)."""
......
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