set current year as initial

This commit is contained in:
2022-01-24 13:08:25 +00:00
parent 626da78994
commit 76d4321a1e

View File

@@ -8,6 +8,7 @@ from django.contrib import messages
from django.http import HttpResponse, Http404
from django.shortcuts import render
from django.template.loader import render_to_string
from django.utils import timezone
from authentications.decorators import authenticated_user
from documents.api import get_pad_link
@@ -62,8 +63,12 @@ def index(request):
fet_meeting_only,
)
else:
form = PostSearchForm()
posts = Post.objects.date_sorted_list(public_only)
data = {
'year': timezone.now().year,
}
form = PostSearchForm(data)
posts = Post.objects.date_filtered_list(public_only, data["year"])
if posts:
taglist = map(lambda post: post.tags, posts)