Fix and test attribution view

This commit is contained in:
Claude Paroz 2017-07-19 17:53:19 +02:00
parent 08c7bd786f
commit 68ddf09d44
2 changed files with 10 additions and 1 deletions

View file

@ -152,7 +152,7 @@ class AttributionView(TemplateView):
# Populate each referent with the number of referencies done during the current school year
ref_counts = dict([(ref.id, ref.num_refs)
for ref in Referent.objects.filter(archived=False, training__availability__period__end_date__gte=school_year_start()
for ref in Teacher.objects.filter(archived=False, training__availability__period__end_date__gte=school_year_start()
).annotate(num_refs=Count('training'))])
for ref in referents:
ref.num_refs = ref_counts.get(ref.id, 0)