diff --git a/docs/conf.py b/docs/conf.py
index fb81bb52..0a3b2c2b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -320,7 +320,7 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
- "https://docs.python.org/": None,
+ "python": ("https://docs.python.org/", None),
"invenio-accounts": ("https://invenio-accounts.readthedocs.io/en/latest/", None),
}
diff --git a/invenio_oauthclient/ext.py b/invenio_oauthclient/ext.py
index 291c811a..ab3d180f 100644
--- a/invenio_oauthclient/ext.py
+++ b/invenio_oauthclient/ext.py
@@ -13,7 +13,11 @@
from flask import request
from flask_login import user_logged_out
+from flask_menu import current_menu
from flask_principal import identity_loaded
+from invenio_i18n import LazyString
+from invenio_i18n import lazy_gettext as _
+from invenio_theme.proxies import current_theme_icons
from . import config, handlers
from .utils import (
@@ -233,7 +237,6 @@ def override_template_configuration(app):
def init_index_menu(app):
"""Init index menu."""
- menu = app.extensions["menu"]
def active_when():
return request.endpoint.startswith("invenio_oauthclient_settings.")
@@ -241,20 +244,18 @@ def active_when():
def visible_when():
return bool(app.config.get("OAUTHCLIENT_REMOTE_APPS")) is not False
- menu.submenu("settings.oauthclient").register(
+ current_menu.submenu("settings.oauthclient").register(
"invenio_oauthclient_settings.index",
_(
"%(icon)s Linked accounts",
- icon=make_lazy_string(
- lambda: f''
- ),
+ icon=LazyString(lambda: f''),
),
order=3,
active_when=active_when,
visible_when=visible_when,
)
- menu.submenu("breadcrumbs.settings.oauthclient").register(
+ current_menu.submenu("breadcrumbs.settings.oauthclient").register(
"invenio_oauthclient_settings.index",
_("Linked accounts"),
)
diff --git a/tests/conftest.py b/tests/conftest.py
index ce77de8d..097951ac 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -3,6 +3,7 @@
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2018 University of Chicago.
+# Copyright (C) 2023-2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
@@ -140,6 +141,7 @@ def base_app(request):
APP_ALLOWED_HOSTS=["localhost"],
APP_THEME=["semantic-ui"],
THEME_ICONS={"semantic-ui": dict(link="linkify icon")},
+ OAUTHCLIENT_SETTINGS_TEMPLATE="invenio_oauthclient/settings/base.html",
)
FlaskMenu(base_app)
Babel(base_app)