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