Opened 3 years ago
Closed 3 years ago
#34197 closed New feature (duplicate)
method_decorator does not work with async views
| Reported by: | Hugo Osvaldo Barrera | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 4.1 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
This:
@method_decorator(atomic, name="post")
Doesn't work on an async view:
ValueError: The view idf.sync.views.view didn't return an HttpResponse object. It returned an unawaited coroutine instead. You may need to add an 'await' into your view.
The same view works without the decorator.
Change History (1)
comment:1 by , 3 years ago
| Component: | Utilities → Database layer (models, ORM) |
|---|---|
| Resolution: | → duplicate |
| Status: | new → closed |
| Type: | Uncategorized → New feature |
Note:
See TracTickets
for help on using tickets.
I think it's about
@atomicrather than@method_decorator. Duplicate of #33882.