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

Fix homepage query

parent 35640131
No related branches found
No related tags found
No related merge requests found
...@@ -95,11 +95,18 @@ def _db_execute_get_homepage(session: SessionDb, is_mod: bool): ...@@ -95,11 +95,18 @@ def _db_execute_get_homepage(session: SessionDb, is_mod: bool):
], ],
visibility_check=True, visibility_check=True,
) )
.order_by(Lecture.publish_time.desc(), Lecture.time.desc(), Lecture.id.asc()) .where(Lecture.publish_time.is_not(None))
.order_by(Lecture.publish_time.desc())
.limit(6) .limit(6)
).all() ).all()
featured = session.scalars( featured = session.scalars(
Featured.select(is_mod, [LOAD_FEATURED_COURSE_OR_LECTURE]) Featured.select(is_mod, [
LOAD_FEATURED_COURSE_OR_LECTURE,
LOAD_LECTURE_COURSE,
LOAD_LECTURE_CHAPTERS,
LOAD_LECTURE_PUBLISH_MEDIA,
LOAD_PUBLISH_MEDIUM_TARGET_MEDIUM
])
.order_by(Featured.display_priority.asc()) .order_by(Featured.display_priority.asc())
).all() ).all()
session.expunge_all() session.expunge_all()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment