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

This commit is contained in:
2024-09-16 09:43:40 +02:00
parent 13ed0bbc1f
commit 2af8bdeba4

View File

@@ -84,8 +84,11 @@ def EventListAsJSONView(request):
filter_exp &= Q(sport__in=filter_cleaned) | Q(level__in=filter_cleaned)
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]
response = JsonResponse(data, safe=False)
data = {}
for event in qs:
data[event.id] = event.as_dict(json=True, add_registration_url=True)
response = JsonResponse(data)
return response