@@ -22,6 +22,7 @@ def checkpoint_callable(
2222 pass_url : t .Optional [t .Union [str , t .Callable [[], t .Any ]]] = None ,
2323 message : t .Optional [str ] = None ,
2424 message_category : str = "message" ,
25+ disable_default_fail : bool = False ,
2526) -> t .Callable [..., t .Any ]:
2627 """
2728 A decorator that evaluates if the passed in callable is truly.
@@ -98,6 +99,7 @@ def number():
9899 :param pass_url: the url to redirect to if the callable passes
99100 :param message: if a message is specified, a flash message is shown
100101 :param message_category: the category of the flash message
102+ :param disable_default_fail: if True, the callable will be called without default failure handling
101103 :return: the decorated callable, or abort(abort_status) response
102104 """
103105
@@ -161,6 +163,9 @@ def inner(*args: t.Any, **kwargs: t.Any) -> t.Any:
161163
162164 raise TypeError ("Pass URL must either be a string or a partial" )
163165
166+ if not disable_default_fail :
167+ return func (* args , ** kwargs )
168+
164169 return abort (fail_status )
165170
166171 return inner
0 commit comments