Skip to content

Commit

Permalink
Refactor BouncedEmailAPI to include JSONParser for parsing request data
Browse files Browse the repository at this point in the history
  • Loading branch information
QA2A committed Aug 15, 2024
1 parent bef392d commit 09dfa4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 09dfa4d

Please sign in to comment.