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

Fix filter_participant to include only direct members

parent 94565270
No related branches found
No related tags found
1 merge request!76Fix filter_participant to include only direct members
Pipeline #3257 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