From 57d9f167a5a04c76c357207ecf8790e5dd33b38c Mon Sep 17 00:00:00 2001 From: Gregoo Date: Fri, 24 Jan 2025 10:27:06 +0100 Subject: [PATCH] Allow exception_handler to pass kwargs to the wrapped function --- bricktracker/views/exceptions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bricktracker/views/exceptions.py b/bricktracker/views/exceptions.py index 562606a..b78c390 100644 --- a/bricktracker/views/exceptions.py +++ b/bricktracker/views/exceptions.py @@ -27,7 +27,8 @@ def exception_handler( /, *, json: bool = False, - post_redirect: str | None = None + post_redirect: str | None = None, + **superkwargs, ) -> Callable[[ViewCallable], ViewCallable]: def outer(function: ViewCallable, /) -> ViewCallable: @wraps(function) @@ -42,6 +43,7 @@ def exception_handler( json=json, post_redirect=post_redirect, **kwargs, + **superkwargs, ) return wrapper return outer