From 626da78994f2e1f085247771417a3f7924fd2e49 Mon Sep 17 00:00:00 2001 From: Patrick Mayr Date: Mon, 24 Jan 2022 13:07:56 +0000 Subject: [PATCH] reverse year range --- fet2020/posts/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fet2020/posts/forms.py b/fet2020/posts/forms.py index 9041c1bb..34727578 100644 --- a/fet2020/posts/forms.py +++ b/fet2020/posts/forms.py @@ -177,7 +177,7 @@ class PostSearchForm(forms.Form): first_post = Post.objects.get_queryset().last() last_post = Post.objects.get_queryset().first() if first_post and last_post: - years = range(first_post.date.year, last_post.date.year + 1) + years = range(last_post.date.year, first_post.date.year - 1, -1) year_choices = [("", _("Alle"))] + [(i, i) for i in years] self.fields["year"].choices = year_choices except: