mirror of https://github.com/apache/superset.git
fix(chore): switching between languages should be without timeout 60 seconds (#24798)
This commit is contained in:
parent
4a81284056
commit
761fec2574
|
@ -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),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue