Skip to content

Commit

Permalink
init: move breadcrumb into finalize_app
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed May 13, 2023
1 parent d1e08cd commit 1b7cd2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 10 additions & 0 deletions invenio_userprofiles/finalize_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
def finalize_app(app):
"""Finalize app."""
init_menu()
init_breadcrumb()


def init_menu():
Expand All @@ -30,3 +31,12 @@ def init_menu():
),
order=0,
)


def init_breadcrumb():
"""Init breadcrumb."""
item = current_menu.submenu("breadcrumbs.settings.profile")
item.register(
"invenio_userprofiles.profile",
_("Profile"),
)
2 changes: 0 additions & 2 deletions invenio_userprofiles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
request,
url_for,
)
from flask_breadcrumbs import register_breadcrumb
from flask_login import current_user, login_required
from flask_security.confirmable import send_confirmation_instructions
from invenio_db import db
Expand Down Expand Up @@ -89,7 +88,6 @@ def userprofile(value):

@blueprint.route("/", methods=["GET", "POST"])
@login_required
@register_breadcrumb(blueprint, "breadcrumbs.settings.profile", _("Profile"))
def profile():
"""View for editing a profile."""
# Create forms
Expand Down

0 comments on commit 1b7cd2e

Please sign in to comment.