#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 Mariusz Felisiak, 17 months ago

Component: UtilitiesDatabase layer (models, ORM)
Resolution: duplicate
Status: newclosed
Type: UncategorizedNew feature

I think it's about @atomic rather than @method_decorator. Duplicate of #33882.

Note: See TracTickets for help on using tickets.
Back to Top