#35083: Make django.utils.decorators.method_decorator work with async functions.
------------------------------+------------------------------------
Reporter: Drew Winstel | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: 5.0
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Comment (by Drew Winstel):
> Out of interest though, View standardly has a sync dispatch, which
you've overridden here:
Right, that's because strawberry's `dispatch()` is overridden as well:
https://github.com/strawberry-
graphql/strawberry/blob/main/strawberry/django/views.py#L266-L277
> Likely off-topic but just for future context, Drew could you maybe
briefly say how it comes up — I guess the Strawberry base class is async
def all the way... or ... 🤔?
It does inherit from `django.views.generic.View`, but `dispatch()` is a
clean break from the generic view's version.
Strawberry's view includes the `@csrf_exempt()` decorator, but we (at my
day job) need `@ensure_csrf_cookie()` applied to that view because of
weird node.js things that I don't even pretend to understand. :D
--
Ticket URL: <https://code.djangoproject.com/ticket/35083#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018cd4a5c693-409cc47c-a37d-4b4b-b17c-93ae112ff513-000000%40eu-central-1.amazonses.com.