diff --git a/config/settings/common_settings.py b/config/settings/common_settings.py index c2d6e52d30..2e5bb1c3ee 100644 --- a/config/settings/common_settings.py +++ b/config/settings/common_settings.py @@ -182,6 +182,9 @@ def pipe_delim(pipe_string): 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated', ], + 'DEFAULT_PARSER_CLASSES': [ + 'rest_framework.parsers.JSONParser', + ], 'DEFAULT_FILTER_BACKENDS': ( 'django_filters.rest_framework.DjangoFilterBackend', 'rest_framework.filters.OrderingFilter', diff --git a/mathesar/api/db/viewsets/data_files.py b/mathesar/api/db/viewsets/data_files.py index f2477d22c2..fc20278de3 100644 --- a/mathesar/api/db/viewsets/data_files.py +++ b/mathesar/api/db/viewsets/data_files.py @@ -2,6 +2,7 @@ from rest_framework import status, viewsets from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin from rest_framework.response import Response +from rest_framework.parsers import MultiPartParser, JSONParser from mathesar.api.dj_filters import DataFileFilter import mathesar.api.exceptions.data_import_exceptions.exceptions @@ -21,6 +22,7 @@ class DataFileViewSet(viewsets.GenericViewSet, ListModelMixin, RetrieveModelMixi pagination_class = DefaultLimitOffsetPagination filter_backends = (filters.DjangoFilterBackend,) filterset_class = DataFileFilter + parser_classes = [MultiPartParser, JSONParser] def partial_update(self, request, pk=None): serializer = DataFileSerializer(