diff --git a/cntmanage/flightslot/actions/exportweek.py b/cntmanage/flightslot/actions/exportweek.py index 9654ab8..c2e82ab 100644 --- a/cntmanage/flightslot/actions/exportweek.py +++ b/cntmanage/flightslot/actions/exportweek.py @@ -79,7 +79,7 @@ def export_selected(request: HttpRequest, queryset: QuerySet[WeekPreference]) -> # Each of this iterations fills the table for a student row: int = 2 row_offset: int = 0 - for i, q in enumerate(queryset.order_by("student__surname", "student__name", "student__course"), start=1): + for i, q in enumerate(queryset.order_by("week", "student__surname", "student__name", "student__course"), start=1): student_data: List[str] student_phone: str = q.student.phone if q.student.phone else "" student_email: str = q.student.email