Verified Commit a346bc62 authored by Oliver Falk's avatar Oliver Falk
Browse files

JSON of course return json, but also normal web requests

parent c5f49317
Pipeline #2072 passed with stage
in 8 minutes and 33 seconds
......@@ -411,7 +411,8 @@ class StatsView(TemplateView, JsonResponse):
'openids': ConfirmedOpenId.objects.all().count(), # pylint: disable=no-member
}
if request.content_type == 'application/json':
# JSON of course return json, but also normal web requests default to JSON
if request.content_type == 'application/json' or request.content_type == 'text/plain':
return JsonResponse(retval)
return HttpResponseRedirect(reverse_lazy('home'))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment