From 09dfa4d64218cd3f062df245c13eab5a7b93299c Mon Sep 17 00:00:00 2001 From: QA2A <150867722+QA2A@users.noreply.github.com> Date: Thu, 15 Aug 2024 18:03:32 -0400 Subject: [PATCH] Refactor BouncedEmailAPI to include JSONParser for parsing request data --- website/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/views.py b/website/views.py index a3e2a50..c476840 100644 --- a/website/views.py +++ b/website/views.py @@ -29,7 +29,7 @@ from requests.exceptions import RequestException from rest_framework import status from rest_framework.exceptions import ValidationError -from rest_framework.parsers import FormParser, MultiPartParser +from rest_framework.parsers import FormParser, JSONParser, MultiPartParser from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView @@ -92,6 +92,7 @@ def get_queryset(self): class BouncedEmailAPI(APIView): permission_classes = [IsAuthenticated] + parser_classes = [FormParser, MultiPartParser, JSONParser] def post(self, request, *args, **kwargs): # Use request.data to get the POST data