|
28 | 28 | from django.template.exceptions import TemplateDoesNotExist
|
29 | 29 | from django.template.loader import render_to_string
|
30 | 30 | from django.template.response import TemplateResponse
|
31 |
| -from django.utils.decorators import classonlymethod, method_decorator |
32 |
| -from django.views.decorators.csrf import csrf_exempt |
| 31 | +from django.utils.decorators import classonlymethod |
33 | 32 | from django.views.generic import View
|
34 | 33 |
|
35 | 34 | from strawberry.http.async_base_view import AsyncBaseHTTPView, AsyncHTTPRequestAdapter
|
@@ -147,11 +146,13 @@ def __init__(
|
147 | 146 | graphql_ide: Optional[GraphQL_IDE] = "graphiql",
|
148 | 147 | allow_queries_via_get: bool = True,
|
149 | 148 | subscriptions_enabled: bool = False,
|
| 149 | + multipart_uploads_enabled: bool = False, |
150 | 150 | **kwargs: Any,
|
151 | 151 | ) -> None:
|
152 | 152 | self.schema = schema
|
153 | 153 | self.allow_queries_via_get = allow_queries_via_get
|
154 | 154 | self.subscriptions_enabled = subscriptions_enabled
|
| 155 | + self.multipart_uploads_enabled = multipart_uploads_enabled |
155 | 156 |
|
156 | 157 | if graphiql is not None:
|
157 | 158 | warnings.warn(
|
@@ -229,7 +230,6 @@ def get_context(self, request: HttpRequest, response: HttpResponse) -> Any:
|
229 | 230 | def get_sub_response(self, request: HttpRequest) -> TemporalHttpResponse:
|
230 | 231 | return TemporalHttpResponse()
|
231 | 232 |
|
232 |
| - @method_decorator(csrf_exempt) |
233 | 233 | def dispatch(
|
234 | 234 | self, request: HttpRequest, *args: Any, **kwargs: Any
|
235 | 235 | ) -> Union[HttpResponseNotAllowed, TemplateResponse, HttpResponseBase]:
|
@@ -288,7 +288,6 @@ async def get_context(self, request: HttpRequest, response: HttpResponse) -> Any
|
288 | 288 | async def get_sub_response(self, request: HttpRequest) -> TemporalHttpResponse:
|
289 | 289 | return TemporalHttpResponse()
|
290 | 290 |
|
291 |
| - @method_decorator(csrf_exempt) |
292 | 291 | async def dispatch( # pyright: ignore
|
293 | 292 | self, request: HttpRequest, *args: Any, **kwargs: Any
|
294 | 293 | ) -> Union[HttpResponseNotAllowed, TemplateResponse, HttpResponseBase]:
|
|
0 commit comments