From 5eff54cffecd5616be658d4719829ac7b3aac4d5 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 27 Jun 2018 12:34:41 +0200 Subject: [PATCH] Fix a bug -- json not imported; use JsonResponse instead of HttpResponse --- hosting/views.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 07bafd97..e5383535 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1266,10 +1266,7 @@ class VirtualMachineView(LoginRequiredMixin, View): ["%s=%s" % (k, v) for (k, v) in admin_email_body.items()]), } send_plain_email_task.delay(email_to_admin_data) - return HttpResponse( - json.dumps(response), - content_type="application/json" - ) + return JsonResponse(response) class HostingBillListView(PermissionRequiredMixin, LoginRequiredMixin,