Use proper HttpRequest object to call a Django view

humitos/pur/update
Manuel Kaufmann 2018-10-27 18:14:52 +02:00
parent 1c6a0938c4
commit e3ad2a27c3
1 changed files with 5 additions and 1 deletions

View File

@ -343,4 +343,8 @@ class WebhookView(APIView):
)
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)