Skip to content
Snippets Groups Projects
Commit 7006fdd6 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'fix/filter-participant' into 'master'

Fix filter_participant to include only direct members

See merge request !76
parents 94565270 240a566a
No related branches found
No related tags found
1 merge request!76Fix filter_participant to include only direct members
Pipeline #3262 passed
......@@ -203,9 +203,6 @@ class LessonDataQuerySet(models.QuerySet, WeekQuerySetMixin):
"""Filter for all lessons a participant (student) attends."""
return self.filter(
Q(**{self._period_path + "lesson__groups__members": person})
| Q(
**{self._period_path + "lesson__groups__parent_groups__members": person}
)
)
def filter_group(self, group: Union[Group, int]):
......@@ -268,7 +265,7 @@ class LessonDataQuerySet(models.QuerySet, WeekQuerySetMixin):
elif type_ == TimetableType.GROUP:
# Student
return self.filter(lesson__groups__members=person)
return self.filter_participant(person)
else:
# If no student or teacher
......
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