dav_registration: made the new JSON-View export a dict instead of a list
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 3m33s
All checks were successful
Run tests / Execute tox to run the test suite (push) Successful in 3m33s
This commit is contained in:
@@ -84,8 +84,11 @@ def EventListAsJSONView(request):
|
|||||||
filter_exp &= Q(sport__in=filter_cleaned) | Q(level__in=filter_cleaned)
|
filter_exp &= Q(sport__in=filter_cleaned) | Q(level__in=filter_cleaned)
|
||||||
|
|
||||||
qs = Event.objects.filter(filter_exp).order_by('first_day', 'number').distinct()
|
qs = Event.objects.filter(filter_exp).order_by('first_day', 'number').distinct()
|
||||||
data = [event.as_dict(json=True, add_registration_url=True) for event in qs]
|
data = {}
|
||||||
response = JsonResponse(data, safe=False)
|
for event in qs:
|
||||||
|
data[event.id] = event.as_dict(json=True, add_registration_url=True)
|
||||||
|
|
||||||
|
response = JsonResponse(data)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user