Skip to content

Commit

Permalink
fix: invalid response type on post request
Browse files Browse the repository at this point in the history
  • Loading branch information
pb82 committed Oct 31, 2024
1 parent 68055bb commit 4173820
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions awx/api/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -81,6 +81,7 @@


class LoggedLoginView(auth_views.LoginView):

def get(self, request, *args, **kwargs):
if is_proxied_request():
next = request.GET.get('next', "")
Expand All @@ -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(

Check warning on line 109 in awx/api/generics.py

View check run for this annotation

Codecov / codecov/patch

awx/api/generics.py#L109

Added line #L109 was not covered by tests
{
'detail': _('Please log in via Platform Authentication.'),
},
Expand Down

0 comments on commit 4173820

Please sign in to comment.