Re: [Django] #35083: Make django.utils.decorators.method_decorator work with async functions. (was: @method_decorator and iscoroutinefunction() fail to interact properly on async views)

4 views
Skip to first unread message

Django

unread,
Jan 3, 2024, 2:15:52 PM1/3/24
to django-...@googlegroups.com
#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
------------------------------+------------------------------------
Changes (by Natalia Bidart):

* cc: Carlton Gibson (added)
* type: Uncategorized => New feature
* component: Uncategorized => Utilities
* stage: Unreviewed => Accepted


Comment:

Hello Drew, thanks for your report!

From my understanding of the code, the decorators in
django.utils.decorators do not work with async functions (except for
`make_middleware_decorator`). I believe this ticket is similar to #31949,
#33882, and #35030. What's needed is to grow `method_decorator` so the
`decorator` param is tested for `iscoroutinefunction`.

Accepting on that premise as a new feature.

--
Ticket URL: <https://code.djangoproject.com/ticket/35083#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages