Undo a decorator change and expand unit tests.

Review Request #13386 — Created Oct. 27, 2023 and submitted — Latest diff uploaded

Information

Djblets
release-3.x

Reviewers

My recent decorator improvements turned @webapi_response_errors into a
pass-through decorator, updating the decorated function and returning it
directly instead of wrapping it.

This ended up breaking the case where decorators may stack without
another webapi decorator in-between them.

This change switches it back to returning a proper decorator function
that merges in properties. We could still go with a pass-through
approach and handle the merging within @webapi_response_errors, but it
seems best for now just to keep the logic as it was.

All unit tests pass.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Undo a decorator change and expand unit tests.
My recent decorator improvements turned `@webapi_response_errors` into a pass-through decorator, updating the decorated function and returning it directly instead of wrapping it. This ended up breaking the case where decorators may stack without another webapi decorator in-between them. This change switches it back to returning a proper decorator function that merges in properties. We could still go with a pass-through approach and handle the merging within `@webapi_response_errors`, but it seems best for now just to keep the logic as it was.
37c16e9fb13762875585cd8d5953280826881e2f Christian Hammond
djblets/webapi/decorators.py
djblets/webapi/tests/test_decorators.py
Loading...