From 41738205d08adbe3d56fb65dd276cc5a36d5aaae Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Thu, 31 Oct 2024 12:01:23 +0100 Subject: [PATCH] fix: invalid response type on post request --- awx/api/generics.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/api/generics.py b/awx/api/generics.py index dfe60f52188d..9c400d0b388e 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -13,7 +13,7 @@ from django.core.exceptions import FieldDoesNotExist from django.db import connection, transaction from django.db.models.fields.related import OneToOneRel -from django.http import QueryDict +from django.http import QueryDict, JsonResponse from django.shortcuts import get_object_or_404, redirect from django.template.loader import render_to_string from django.utils.encoding import smart_str @@ -81,6 +81,7 @@ class LoggedLoginView(auth_views.LoginView): + def get(self, request, *args, **kwargs): if is_proxied_request(): next = request.GET.get('next', "") @@ -105,7 +106,7 @@ def get(self, request, *args, **kwargs): def post(self, request, *args, **kwargs): if is_proxied_request(): # Give a message, saying to login via AAP - return Response( + return JsonResponse( { 'detail': _('Please log in via Platform Authentication.'), },