13 lines
290 B
Python
13 lines
290 B
Python
from extensions import flask_app
|
|
|
|
|
|
def with_app_context(func):
|
|
def wrapper(*args, **kwargs):
|
|
if flask_app is None:
|
|
raise RuntimeError("Flask app is not initialized")
|
|
|
|
with flask_app.app_context():
|
|
return func(*args, **kwargs)
|
|
|
|
return wrapper
|