mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-17 13:38:03 +00:00
JSON of course return json, but also normal web requests
This commit is contained in:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user