Allow exception_handler to pass kwargs to the wrapped function
This commit is contained in:
parent
4052ac00ad
commit
57d9f167a5
@ -27,7 +27,8 @@ def exception_handler(
|
|||||||
/,
|
/,
|
||||||
*,
|
*,
|
||||||
json: bool = False,
|
json: bool = False,
|
||||||
post_redirect: str | None = None
|
post_redirect: str | None = None,
|
||||||
|
**superkwargs,
|
||||||
) -> Callable[[ViewCallable], ViewCallable]:
|
) -> Callable[[ViewCallable], ViewCallable]:
|
||||||
def outer(function: ViewCallable, /) -> ViewCallable:
|
def outer(function: ViewCallable, /) -> ViewCallable:
|
||||||
@wraps(function)
|
@wraps(function)
|
||||||
@ -42,6 +43,7 @@ def exception_handler(
|
|||||||
json=json,
|
json=json,
|
||||||
post_redirect=post_redirect,
|
post_redirect=post_redirect,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
|
**superkwargs,
|
||||||
)
|
)
|
||||||
return wrapper
|
return wrapper
|
||||||
return outer
|
return outer
|
||||||
|
Loading…
Reference in New Issue
Block a user