Skip to content

Commit a5523e7

Browse files
authored
fix(github-179): Force the API to only render json (#209)
The issue was cause by the accept header from client being set to html which fails because don't have queryset/get_queryset defined on the class fixes: #179
1 parent c4b1171 commit a5523e7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

api/features/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from rest_framework.decorators import action
1212
from rest_framework.generics import GenericAPIView, get_object_or_404
1313
from rest_framework.permissions import IsAuthenticated
14+
from rest_framework.renderers import JSONRenderer
1415
from rest_framework.response import Response
1516
from rest_framework.schemas import AutoSchema
1617

@@ -334,6 +335,7 @@ class SDKFeatureStates(GenericAPIView):
334335
serializer_class = FeatureStateSerializerFull
335336
permission_classes = (EnvironmentKeyPermissions,)
336337
authentication_classes = (EnvironmentKeyAuthentication,)
338+
renderer_classes = [JSONRenderer]
337339

338340
schema = AutoSchema(
339341
manual_fields=[

0 commit comments

Comments
 (0)