Skip to content

Commit 1c7cfd9

Browse files
committed
remove formless browsable api enforcement
1 parent 4f3adae commit 1c7cfd9

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

drf_sideloading/mixins.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from rest_framework.response import Response
1111
from rest_framework.serializers import ListSerializer
1212

13-
from drf_sideloading.renderers import BrowsableAPIRendererWithoutForms
1413
from drf_sideloading.serializers import SideLoadableSerializer
1514

1615

@@ -130,20 +129,6 @@ def get_sideloading_serializer_context(self):
130129

131130
# modified DRF methods
132131

133-
def initialize_request(self, request, *args, **kwargs):
134-
"""
135-
Disable BrowsableAPIForms during sideloading
136-
"""
137-
request = super(SideloadableRelationsMixin, self).initialize_request(request=request, *args, **kwargs)
138-
139-
if self.sideloading_query_param_name in request.query_params:
140-
if isinstance(self.renderer_classes, (list, tuple)):
141-
self.renderer_classes = [
142-
BrowsableAPIRendererWithoutForms if r == BrowsableAPIRenderer else r for r in self.renderer_classes
143-
]
144-
145-
return request
146-
147132
def retrieve(self, request, *args, **kwargs):
148133
if self.sideloading_query_param_name not in request.query_params:
149134
return super().retrieve(request, *args, **kwargs)

drf_sideloading/renderers.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)