fixed issue with site settings template
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from flask import Blueprint, Flask, render_template
|
from flask import Blueprint, Flask, render_template
|
||||||
from flask_login import login_required
|
from flask_login import login_required
|
||||||
|
from models import SiteSettings
|
||||||
|
|
||||||
def init_app(app: Flask):
|
def init_app(app: Flask):
|
||||||
# Create blueprints
|
# Create blueprints
|
||||||
@@ -17,6 +18,12 @@ def init_app(app: Flask):
|
|||||||
init_main_routes(main_bp)
|
init_main_routes(main_bp)
|
||||||
init_auth_routes(auth_bp)
|
init_auth_routes(auth_bp)
|
||||||
|
|
||||||
|
# Add site_settings context processor to all blueprints
|
||||||
|
@app.context_processor
|
||||||
|
def inject_site_settings():
|
||||||
|
site_settings = SiteSettings.query.first()
|
||||||
|
return dict(site_settings=site_settings)
|
||||||
|
|
||||||
# Register blueprints
|
# Register blueprints
|
||||||
app.register_blueprint(main_bp)
|
app.register_blueprint(main_bp)
|
||||||
app.register_blueprint(auth_bp)
|
app.register_blueprint(auth_bp)
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user