Skip to content

Commit f95cae3

Browse files
committed
Use proper HttpRequest object to call a Django view
1 parent 51a1e38 commit f95cae3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

readthedocs/restapi/views/integrations.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,8 @@ def post(self, request, project_slug, integration_pk):
343343
)
344344
view_cls = self.VIEW_MAP[integration.integration_type]
345345
view = view_cls.as_view(integration=integration)
346-
return view(request, project_slug)
346+
# DRF uses ``rest_framework.request.Request`` and Django expects
347+
# ``django.http.HttpRequest``
348+
# https://www.django-rest-framework.org/api-guide/requests/
349+
# https://github.com/encode/django-rest-framework/pull/5771#issuecomment-362815342
350+
return view(request._request, project_slug)

0 commit comments

Comments
 (0)