diff --git a/readthedocs/restapi/views/integrations.py b/readthedocs/restapi/views/integrations.py index f2ec92dd030..35e5fab11ee 100644 --- a/readthedocs/restapi/views/integrations.py +++ b/readthedocs/restapi/views/integrations.py @@ -343,4 +343,8 @@ def post(self, request, project_slug, integration_pk): ) view_cls = self.VIEW_MAP[integration.integration_type] view = view_cls.as_view(integration=integration) - return view(request, project_slug) + # DRF uses ``rest_framework.request.Request`` and Django expects + # ``django.http.HttpRequest`` + # https://www.django-rest-framework.org/api-guide/requests/ + # https://github.com/encode/django-rest-framework/pull/5771#issuecomment-362815342 + return view(request._request, project_slug)