Commit fa4f54d3 authored by Joren Vrancken's avatar Joren Vrancken
Browse files

Merge branch 'fix/documents-keyerror' into 'master'

Fix KeyError in documents package

See merge request !774
parents 98e26e00 2835f036
......@@ -19,8 +19,12 @@ def index(request):
for policy in AnnualDocument.objects.filter(subcategory='policy'):
years[policy.year]['policy'] = policy
for report in AnnualDocument.objects.filter(subcategory='report'):
if 'report' not in years[report.year]:
years[report.year]['report'] = {}
years[report.year]['report']['annual'] = report
for financial in AnnualDocument.objects.filter(subcategory='financial'):
if 'report' not in years[financial.year]:
years[financial.year]['report'] = {}
years[financial.year]['report']['financial'] = financial
meeting_years = {x: [] for x in range(1990, lectureyear + 1)}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment