no years for projects, works

This commit is contained in:
root 2018-08-22 16:40:36 +00:00
parent 787e0e22e8
commit 3d84677b70

View File

@ -95,7 +95,12 @@ def section_list(request, section):
q = request.GET.get('q')
content = limit_content(content, q)
year = request.GET.get('year', '')
context = filter_by_years(content, year)
if year or section not in ('Projects', 'Works'):
context = filter_by_years(content, year)
else:
context = {
'content': content
}
'''
page = request.GET.get('page', 1)
@ -270,7 +275,7 @@ def redirect_index(request):
return redirect(reverse('index'))
def redirect_event(request):
shortname = request.GET.get('this').replace(' ', '_').lower()
shortname = request.GET.get('this', '').replace(' ', '_').lower()
if shortname:
content = get_object_or_404(Content, shortname__iexact=shortname)
return redirect(content.get_absolute_url())