Skip to content
Snippets Groups Projects
Commit f3eea35e authored by Simon Künzel's avatar Simon Künzel
Browse files

Fix missing chapter ordering

parent 04043cce
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,7 @@ class Lecture(DeletableApiObject, VisibilityApiObject, ApiViewPermissionsObject,
chapters: Mapped[list[Chapter]] = relationship(
back_populates="lecture",
primaryjoin=lambda: sql.and_(Chapter.lecture_id == Lecture.id, Chapter.has_access(is_mod=True)),
order_by=Chapter.start_time.asc(),
lazy="raise_on_sql"
)
# noinspection PyUnresolvedReferences
......@@ -208,6 +209,7 @@ class Lecture(DeletableApiObject, VisibilityApiObject, ApiViewPermissionsObject,
public_chapters: Mapped[list[Chapter]] = relationship(
back_populates="lecture",
primaryjoin=lambda: sql.and_(Chapter.lecture_id == Lecture.id, Chapter.has_access(is_mod=False)),
order_by=Chapter.start_time.asc(),
lazy="raise_on_sql",
viewonly=True
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment