Commit 4b6a620b authored by Elger Jonker's avatar Elger Jonker

graphs only for one year, not all time

Former-commit-id: 3375b081
parent a2fd15d3
......@@ -961,8 +961,10 @@ def vulnerability_graphs(request, country: str = "NL", organization_type="munici
country = get_country(country)
when = - relativedelta(weeks=int(weeks_back))
one_year_ago = when - timedelta(days=365)
data = VulnerabilityStatistic.objects.all().filter(
organization_type=organization_type_id, country=country, when__lte=when
organization_type=organization_type_id, country=country, when__lte=when, when__gte=one_year_ago
).order_by('scan_type', 'when')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment