From f0bcc4dcf1784580e0a4ac9dd33f1507d47e6e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20R=C3=BCdenauer?= Date: Mon, 2 Jun 2025 01:46:05 +0200 Subject: [PATCH] Use member 'cfg' of class ThemeSupport consistently instead of taking it from the flask application context --- src/moin/themes/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/moin/themes/__init__.py b/src/moin/themes/__init__.py index 16c2778b3..d87c84cad 100644 --- a/src/moin/themes/__init__.py +++ b/src/moin/themes/__init__.py @@ -184,8 +184,8 @@ def get_action_tabs(self, fqname, current_endpoint): navtabs = [] spl_active = [("frontend.history", "frontend.diff")] - for endpoint, label, title, check_exists in app.cfg.item_views: - if endpoint not in app.cfg.endpoints_excluded: + for endpoint, label, title, check_exists in self.cfg.item_views: + if endpoint not in self.cfg.endpoints_excluded: if not check_exists or exists: if endpoint in navtabs_endpoints: @@ -245,8 +245,8 @@ def get_local_panel(self, fqname): item_navigation = [] item_actions = [] - for endpoint, label, title, check_exists in app.cfg.item_views: - if endpoint not in app.cfg.endpoints_excluded: + for endpoint, label, title, check_exists in self.cfg.item_views: + if endpoint not in self.cfg.endpoints_excluded: if not check_exists or item: if endpoint in user_actions_endpoints: if flaskg.user.valid: @@ -280,9 +280,9 @@ def get_local_panel(self, fqname): iconcls = ICON_MAP[endpoint] if endpoint in ICON_MAP else "" if endpoint == "special.supplementation": - for sub_item_name in app.cfg.supplementation_item_names: + for sub_item_name in self.cfg.supplementation_item_names: current_sub = fqname.value.rsplit("/", 1)[-1] - if current_sub not in app.cfg.supplementation_item_names: + if current_sub not in self.cfg.supplementation_item_names: supp_name = f"{fqname.value}/{sub_item_name}" if flaskg.storage.has_item(supp_name) or flaskg.user.may.write(supp_name): subitem_exists = self.storage.has_item(supp_name) @@ -438,7 +438,7 @@ def navibar(self, fqname): if endpoint == "frontend.show_root": endpoint = "frontend.show_item" root_fqname = fqname.get_root_fqname() - default_root = app.cfg.root_mapping.get(NAMESPACE_DEFAULT, app.cfg.default_root) + default_root = self.cfg.root_mapping.get(NAMESPACE_DEFAULT, self.cfg.default_root) args["item_name"] = root_fqname.fullname if fqname.namespace != NAMESPACE_ALL else default_root # override link_text to show untranslated itemname or / link_text = args["item_name"] @@ -508,7 +508,7 @@ def get_namespaces(self): by a wiki user. """ namespace_root_mapping = [] - for namespace, _unused in app.cfg.namespace_mapping: + for namespace, _unused in self.cfg.namespace_mapping: if namespace == NAMESPACE_USERPROFILES: continue namespace = namespace.rstrip("/")