Skip to content
Snippets Groups Projects
Commit ce4a8838 authored by magicfelix's avatar magicfelix
Browse files

Fix teacher timetable

parent eebb1823
No related branches found
No related tags found
1 merge request!301New data model based on calendar events
Pipeline #141656 failed
......@@ -866,10 +866,10 @@ class LessonEventQuerySet(PolymorphicQuerySet):
"""Queryset with special query methods for lesson events."""
def for_teacher(self, teacher: Union[int, Person]):
amended = objs.filter(Q(amended_by__isnull=False) & (Q(teachers=teacher))).values_list(
amended = self.filter(Q(amended_by__isnull=False) & (Q(teachers=teacher))).values_list(
"amended_by__pk", flat=True
)
return objs.filter(Q(teachers=teacher) | Q(pk__in=amended)).distinct()
return self.filter(Q(teachers=teacher) | Q(pk__in=amended)).distinct()
def for_group(self, group: Union[int, Group]):
amended = self.filter(
......
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