Skip to content

Commit

Permalink
don't get user if id is None
Browse files Browse the repository at this point in the history
  • Loading branch information
zef committed Dec 22, 2023
1 parent 59d8703 commit c681637
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions superset/tasks/async_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def load_explore_json_into_cache( # pylint: disable=too-many-locals
) -> None:
cache_key_prefix = "ejr-" # ejr: explore_json request

user = (
security_manager.get_user_by_id(job_metadata.get("user_id"))
or security_manager.get_anonymous_user()
)
if user_id := job_metadata.get("user_id"):
user = security_manager.get_user_by_id(user_id)
else:
user = security_manager.get_anonymous_user()

with override_user(user, force=False):
try:
Expand Down

0 comments on commit c681637

Please sign in to comment.