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

Fix position of order_by in lessons_on_day query on person model

The order_by wasn't used in the old position because filter_person
uses an union query.
parent 9c92bdfc
No related branches found
No related tags found
1 merge request!143Resolve "Next/prev functions for persons don't return the next/prev lesson"
Pipeline #6687 passed
......@@ -83,7 +83,7 @@ def lesson_periods_as_teacher(self):
@Person.method
def lessons_on_day(self, day: date):
"""Get all lessons of this person (either as participant or teacher) on the given day."""
return LessonPeriod.objects.order_by("period__period").on_day(day).filter_from_person(self)
return LessonPeriod.objects.on_day(day).filter_from_person(self).order_by("period__period")
@Person.method
......
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