From be545e5f4cf28fe94559869fd0a5efdb3272b985 Mon Sep 17 00:00:00 2001 From: Ansh Agrawal <96297836+hsna674@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:27:42 -0400 Subject: [PATCH] Return http response errors as json Co-authored-by: Aarush Deshpande <110117391+JasonGrace2282@users.noreply.github.com> --- tin/apps/users/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tin/apps/users/views.py b/tin/apps/users/views.py index d539075d..0a7ab4d4 100644 --- a/tin/apps/users/views.py +++ b/tin/apps/users/views.py @@ -16,5 +16,5 @@ def change_theme(request): request.user.save() return http.JsonResponse({"success": True}) else: - return http.JsonResponse({"success": False, "errors": form.errors}, status=400) + return http.JsonResponse({"success": False, "errors": form.errors.as_json()}, status=400) raise http.Http404