You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2026/06/09 22:01:50 UTC
(superset) branch master updated: fix: replace deprecated appbuilder.app with current_app (#40876)
This is an automated email from the ASF dual-hosted git repository.
eschutho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new c0e78f39d7b fix: replace deprecated appbuilder.app with current_app (#40876)
c0e78f39d7b is described below
commit c0e78f39d7bee46ee3f690fad129639034c59ae3
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Tue Jun 9 15:01:43 2026 -0700
fix: replace deprecated appbuilder.app with current_app (#40876)
Co-authored-by: Claude Sonnet 4.6 <no...@anthropic.com>
---
superset/initialization/__init__.py | 10 +++++-----
superset/templates/superset/spa.html | 2 +-
tests/unit_tests/extension_tests.py | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/superset/initialization/__init__.py b/superset/initialization/__init__.py
index 0b52b4a2452..c54821ccd98 100644
--- a/superset/initialization/__init__.py
+++ b/superset/initialization/__init__.py
@@ -299,7 +299,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
#
# Setup regular views
#
- app_root = appbuilder.app.config["APPLICATION_ROOT"]
+ app_root = current_app.config["APPLICATION_ROOT"]
if app_root.endswith("/"):
app_root = app_root.rstrip("/")
@@ -351,7 +351,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
category="Security",
category_label=_("Security"),
menu_cond=lambda: bool(
- appbuilder.app.config.get("SUPERSET_SECURITY_VIEW_MENU", True)
+ current_app.config.get("SUPERSET_SECURITY_VIEW_MENU", True)
),
)
@@ -361,7 +361,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
label=_("User Registrations"),
category="Security",
category_label=_("Security"),
- menu_cond=lambda: bool(appbuilder.app.config["AUTH_USER_REGISTRATION"]),
+ menu_cond=lambda: bool(current_app.config["AUTH_USER_REGISTRATION"]),
)
appbuilder.add_view(
@@ -371,7 +371,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
category="Security",
category_label=_("Security"),
menu_cond=lambda: bool(
- appbuilder.app.config.get("SUPERSET_SECURITY_VIEW_MENU", True)
+ current_app.config.get("SUPERSET_SECURITY_VIEW_MENU", True)
),
)
@@ -382,7 +382,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
category="Security",
category_label=_("Security"),
menu_cond=lambda: bool(
- appbuilder.app.config.get("SUPERSET_SECURITY_VIEW_MENU", True)
+ current_app.config.get("SUPERSET_SECURITY_VIEW_MENU", True)
),
)
diff --git a/superset/templates/superset/spa.html b/superset/templates/superset/spa.html
index f4132a99fb6..f57f049d94e 100644
--- a/superset/templates/superset/spa.html
+++ b/superset/templates/superset/spa.html
@@ -17,7 +17,7 @@
{% import 'appbuilder/general/lib.html' as lib %}
{% from 'superset/partials/asset_bundle.html' import css_bundle, js_bundle with context %}
{% import "superset/macros.html" as macros %}
- {% set favicons = appbuilder.app.config['FAVICONS'] %}
+ {% set favicons = config['FAVICONS'] %}
<head>
<title>
diff --git a/tests/unit_tests/extension_tests.py b/tests/unit_tests/extension_tests.py
index b10f259d1c1..bc1d52cda1c 100644
--- a/tests/unit_tests/extension_tests.py
+++ b/tests/unit_tests/extension_tests.py
@@ -96,11 +96,11 @@ def test_spa_template_standalone_body_has_min_height():
)
appbuilder = Mock()
- appbuilder.app.config = {"FAVICONS": []}
def render(standalone_mode: bool) -> str:
return env.get_template("spa.html").render(
appbuilder=appbuilder,
+ config={"FAVICONS": []},
assets_prefix="",
bootstrap_data="{}",
entry="spa",