add_ctx
A decorator that ensures the current Flask application context is passed as the first argument to the wrapped function if it is not already present.
def add_ctx(
f: Callable
) - > Callable
Ensures that the current Flask application context is passed as the first positional argument to the decorated function.
Parameters
| Name | Type | Description |
|---|---|---|
| f | Callable | The function to be decorated, which expects a Flask application context as its first positional argument. |
Returns
| Type | Description |
|---|---|
Callable | A wrapped version of the original function that automatically injects the active AppContext if it is missing from the arguments. |