Fixing small errors

This commit is contained in:
Claude Paroz 2012-12-13 00:00:04 +01:00
parent d3afd56946
commit d4435c02ab
4 changed files with 17 additions and 4 deletions

View file

@ -71,7 +71,7 @@ class AttributionView(TemplateView):
def section_periods(request, pk):
""" Return all periods from a section (JSON) """
section = get_object_or_404(Section, pk=pk)
periods = [(p.id, p.dates) for p in section.period_set.all()]
periods = [(p.id, p.dates) for p in section.period_set.all().order_by('start_date')]
return HttpResponse(json.dumps(periods), content_type="application/json")
def section_classes(request, pk):