mirror of
https://github.com/Cian-H/am-d-model.eu.git
synced 2025-12-22 13:41:56 +00:00
Another attempt to fix plugin
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
from flask import Blueprint
|
||||
|
||||
blueprint = Blueprint(
|
||||
"custom_menu",
|
||||
__name__,
|
||||
)
|
||||
|
||||
|
||||
def init_app(app):
|
||||
"""Initialize application."""
|
||||
app.register_blueprint(blueprint)
|
||||
|
||||
from . import views
|
||||
|
||||
app.register_blueprint(views.blueprint)
|
||||
|
||||
@app.before_first_request
|
||||
def init_menus():
|
||||
views.init_menu()
|
||||
|
||||
return app
|
||||
|
||||
@@ -7,7 +7,6 @@ blueprint = Blueprint(
|
||||
)
|
||||
|
||||
|
||||
@blueprint.before_app_first_request
|
||||
def init_menu():
|
||||
"""Add custom items to main menu."""
|
||||
current_menu.submenu("main").register(
|
||||
@@ -18,6 +17,11 @@ def init_menu():
|
||||
)
|
||||
|
||||
|
||||
@blueprint.before_app_first_request
|
||||
def init_menu_on_request():
|
||||
init_menu()
|
||||
|
||||
|
||||
@blueprint.route("/debug-menu")
|
||||
def debug_menu():
|
||||
"""Debug endpoint to view menu structure."""
|
||||
|
||||
Reference in New Issue
Block a user