You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is really only relevant for HttpResponse return values, and wrapping a view function with the decorator is no longer recommended. Extract logic into a separate function and wrap that instead.
BEFORE
# only process side-effects if the HttpResponse is 200 - ignore 404@has_side_effects("foo", run_on_exit: lambdar: r.status_code=200)defview_func(request: HttpRequest) ->HttpResponse:
obj=get_obj_or_404()
obj.foo()
returnHttpResponse("ok")
This is really only relevant for HttpResponse return values, and wrapping a view function with the decorator is no longer recommended. Extract logic into a separate function and wrap that instead.
BEFORE
AFTER
The text was updated successfully, but these errors were encountered: