Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chore): switching between languages should be without timeout 60 seconds #24798

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions superset/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,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 = {
Expand Down Expand Up @@ -456,7 +455,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),
}

Expand Down
Loading