Skip to content

Commit e431b51

Browse files
committed
Change name of flag for accuracy
1 parent 1b4787d commit e431b51

File tree

4 files changed

+20
-23
lines changed

4 files changed

+20
-23
lines changed

dash/_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def load_dash_env_vars():
2929
"DASH_HOT_RELOAD_WATCH_INTERVAL",
3030
"DASH_HOT_RELOAD_MAX_RETRY",
3131
"DASH_SILENCE_ROUTES_LOGGING",
32-
"DASH_SILENCE_UPGRADE_NOTIFICATION",
32+
"DASH_DISABLE_VERSION_CHECK",
3333
"DASH_PRUNE_ERRORS",
3434
"DASH_COMPRESS",
3535
"HOST",

dash/dash-renderer/src/components/error/menu/VersionInfo.react.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ async function requestDashVersionInfo(config) {
3232
ddk_version: ddkVersion,
3333
plotly_version: plotlyVersion
3434
} = config;
35-
if (!shouldRequestDashVersion(config)) {
36-
return {};
37-
}
3835
const cachedVersionInfo = localStorage.getItem('cachedNewDashVersion');
3936
const cachedNewDashVersionLink = localStorage.getItem(
4037
'cachedNewDashVersionLink'
@@ -49,7 +46,7 @@ async function requestDashVersionInfo(config) {
4946
version: JSON.parse(cachedVersionInfo),
5047
link: cachedNewDashVersionLink
5148
};
52-
} else {
49+
} else if (shouldRequestDashVersion(config)) {
5350
const queryParams = new URLSearchParams({
5451
dash_version: currentDashVersion,
5552
python_version: pythonVersion,
@@ -80,7 +77,7 @@ async function requestDashVersionInfo(config) {
8077
function shouldRequestDashVersion(config) {
8178
const showNotificationsLocalStorage =
8279
localStorage.getItem('showNotifications');
83-
const showNotifications = config.silence_upgrade_notification
80+
const showNotifications = config.disable_version_check
8481
? false
8582
: showNotificationsLocalStorage !== 'false';
8683
const lastFetched = localStorage.getItem('lastFetched');
@@ -97,7 +94,7 @@ function shouldShowUpgradeNotification(
9794
) {
9895
const showNotificationsLocalStorage =
9996
localStorage.getItem('showNotifications');
100-
const showNotifications = config.silence_upgrade_notification
97+
const showNotifications = config.disable_version_check
10198
? false
10299
: showNotificationsLocalStorage !== 'false';
103100
const lastDismissed = localStorage.getItem('lastDismissed');

dash/dash.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ def _config(self):
802802
"requests_pathname_prefix": self.config.requests_pathname_prefix,
803803
"ui": self._dev_tools.ui,
804804
"props_check": self._dev_tools.props_check,
805-
"silence_upgrade_notification": self._dev_tools.silence_upgrade_notification,
805+
"disable_version_check": self._dev_tools.disable_version_check,
806806
"show_undo_redo": self.config.show_undo_redo,
807807
"suppress_callback_exceptions": self.config.suppress_callback_exceptions,
808808
"update_title": self.config.update_title,
@@ -1755,9 +1755,9 @@ def _setup_dev_tools(self, **kwargs):
17551755
get_combined_config(attr, kwargs.get(attr, None), default=default)
17561756
)
17571757

1758-
dev_tools["silence_upgrade_notification"] = get_combined_config(
1759-
"silence_upgrade_notification",
1760-
kwargs.get("silence_upgrade_notification", None),
1758+
dev_tools["disable_version_check"] = get_combined_config(
1759+
"disable_version_check",
1760+
kwargs.get("disable_version_check", None),
17611761
default=False,
17621762
)
17631763

@@ -1774,7 +1774,7 @@ def enable_dev_tools(
17741774
dev_tools_hot_reload_watch_interval=None,
17751775
dev_tools_hot_reload_max_retry=None,
17761776
dev_tools_silence_routes_logging=None,
1777-
dev_tools_silence_upgrade_notification=None,
1777+
dev_tools_disable_version_check=None,
17781778
dev_tools_prune_errors=None,
17791779
):
17801780
"""Activate the dev tools, called by `run`. If your application
@@ -1795,7 +1795,7 @@ def enable_dev_tools(
17951795
- DASH_HOT_RELOAD_WATCH_INTERVAL
17961796
- DASH_HOT_RELOAD_MAX_RETRY
17971797
- DASH_SILENCE_ROUTES_LOGGING
1798-
- DASH_SILENCE_UPGRADE_NOTIFICATION
1798+
- DASH_DISABLE_VERSION_CHECK
17991799
- DASH_PRUNE_ERRORS
18001800
18011801
:param debug: Enable/disable all the dev tools unless overridden by the
@@ -1841,10 +1841,10 @@ def enable_dev_tools(
18411841
env: ``DASH_SILENCE_ROUTES_LOGGING``
18421842
:type dev_tools_silence_routes_logging: bool
18431843
1844-
:param dev_tools_silence_upgrade_notification: Silence the upgrade
1844+
:param dev_tools_disable_version_check: Silence the upgrade
18451845
notification to prevent making requests to the Dash server.
1846-
env: ``DASH_SILENCE_UPGRADE_NOTIFICATION``
1847-
:type dev_tools_silence_upgrade_notification: bool
1846+
env: ``DASH_DISABLE_VERSION_CHECK``
1847+
:type dev_tools_disable_version_check: bool
18481848
18491849
:param dev_tools_prune_errors: Reduce tracebacks to just user code,
18501850
stripping out Flask and Dash pieces. Only available with debugging.
@@ -1867,7 +1867,7 @@ def enable_dev_tools(
18671867
hot_reload_watch_interval=dev_tools_hot_reload_watch_interval,
18681868
hot_reload_max_retry=dev_tools_hot_reload_max_retry,
18691869
silence_routes_logging=dev_tools_silence_routes_logging,
1870-
silence_upgrade_notification=dev_tools_silence_upgrade_notification,
1870+
disable_version_check=dev_tools_disable_version_check,
18711871
prune_errors=dev_tools_prune_errors,
18721872
)
18731873

@@ -2067,7 +2067,7 @@ def run(
20672067
dev_tools_hot_reload_watch_interval: Optional[int] = None,
20682068
dev_tools_hot_reload_max_retry: Optional[int] = None,
20692069
dev_tools_silence_routes_logging: Optional[bool] = None,
2070-
dev_tools_silence_upgrade_notification: Optional[bool] = None,
2070+
dev_tools_disable_version_check: Optional[bool] = None,
20712071
dev_tools_prune_errors: Optional[bool] = None,
20722072
**flask_run_options,
20732073
):
@@ -2140,10 +2140,10 @@ def run(
21402140
env: ``DASH_SILENCE_ROUTES_LOGGING``
21412141
:type dev_tools_silence_routes_logging: bool
21422142
2143-
:param dev_tools_silence_upgrade_notification: Silence the upgrade
2143+
:param dev_tools_disable_version_check: Silence the upgrade
21442144
notification to prevent making requests to the Dash server.
2145-
env: ``DASH_SILENCE_UPGRADE_NOTIFICATION``
2146-
:type dev_tools_silence_upgrade_notification: bool
2145+
env: ``DASH_DISABLE_VERSION_CHECK``
2146+
:type dev_tools_disable_version_check: bool
21472147
21482148
:param dev_tools_prune_errors: Reduce tracebacks to just user code,
21492149
stripping out Flask and Dash pieces. Only available with debugging.
@@ -2182,7 +2182,7 @@ def run(
21822182
dev_tools_hot_reload_watch_interval,
21832183
dev_tools_hot_reload_max_retry,
21842184
dev_tools_silence_routes_logging,
2185-
dev_tools_silence_upgrade_notification,
2185+
dev_tools_disable_version_check,
21862186
dev_tools_prune_errors,
21872187
)
21882188

dash/testing/application_runners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def run():
162162
app.css.config.serve_locally = True
163163

164164
options = kwargs.copy()
165-
options["silence_upgrade_notification"] = True
165+
options["disable_version_check"] = True
166166

167167
if "port" not in kwargs:
168168
options["port"] = self.port = BaseDashRunner._next_port

0 commit comments

Comments
 (0)