Skip to content

Commit

Permalink
Use proper HttpRequest object to call a Django view
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Oct 27, 2018
1 parent 1c6a093 commit e3ad2a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion readthedocs/restapi/views/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e3ad2a2

Please sign in to comment.