From d1db0b833f9acc2c03094252e39c448445ccbecc Mon Sep 17 00:00:00 2001 From: Christian Merten Date: Fri, 29 Nov 2024 23:13:46 +0100 Subject: [PATCH] startpage: sort recent posts and reports --- jdav_web/startpage/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdav_web/startpage/views.py b/jdav_web/startpage/views.py index dd84dc7..d7f6eba 100644 --- a/jdav_web/startpage/views.py +++ b/jdav_web/startpage/views.py @@ -22,8 +22,8 @@ def render(request, template_path, context={}): def index(request): context = { - 'recent_posts': Post.objects.filter(section__urlname=settings.RECENT_SECTION), - 'reports': Post.objects.filter(section__urlname=settings.REPORTS_SECTION), + 'recent_posts': Post.objects.filter(section__urlname=settings.RECENT_SECTION).order_by('-date'), + 'reports': Post.objects.filter(section__urlname=settings.REPORTS_SECTION).order_by('-date'), } return render(request, 'startpage/index.html', context)