add_ctx
No overview available.
def add_ctx(
f: F
) - > F
Wraps a function to ensure that an application context is passed as the first argument if it's not already present or is not an AppContext instance. This is useful for functions that operate within a Flask application context.
Parameters
| Name | Type | Description |
|---|---|---|
| f | F | The function to be wrapped. This function is expected to accept an application context as its first argument. |
Returns
| Type | Description |
|---|---|
F | The original function f wrapped with the context-adding logic. |