You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/07/25 18:16:42 UTC

[superset] branch master updated: fix(chore): switching between languages should be without timeout 60 seconds (#24798)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina 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 761fec2574 fix(chore): switching between languages should be without timeout 60 seconds (#24798)
761fec2574 is described below

commit 761fec25740e7cf2d31ba274c7d17cf5366a958f
Author: Stepan <66...@users.noreply.github.com>
AuthorDate: Tue Jul 25 21:16:33 2023 +0300

    fix(chore): switching between languages should be without timeout 60 seconds (#24798)
---
 superset/views/base.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/superset/views/base.py b/superset/views/base.py
index 6b76c28393..34232a6e34 100644
--- a/superset/views/base.py
+++ b/superset/views/base.py
@@ -412,13 +412,12 @@ def menu_data(user: User) -> dict[str, Any]:
 
 
 @cache_manager.cache.memoize(timeout=60)
-def cached_common_bootstrap_data(user: User) -> dict[str, Any]:
+def cached_common_bootstrap_data(user: User, locale: str) -> dict[str, Any]:
     """Common data always sent to the client
 
     The function is memoized as the return value only changes when user permissions
     or configuration values change.
     """
-    locale = str(get_locale())
 
     # should not expose API TOKEN to frontend
     frontend_config = {
@@ -458,7 +457,7 @@ def cached_common_bootstrap_data(user: User) -> dict[str, Any]:
 
 def common_bootstrap_payload(user: User) -> dict[str, Any]:
     return {
-        **(cached_common_bootstrap_data(user)),
+        **cached_common_bootstrap_data(user, get_locale()),
         "flash_messages": get_flashed_messages(with_categories=True),
     }