Skip to content

Commit

Permalink
fix(security) Fixing regression in #9689 (#9705)
Browse files Browse the repository at this point in the history
Co-authored-by: John Bodley <john.bodley@airbnb.com>
  • Loading branch information
john-bodley and john-bodley committed Apr 30, 2020
1 parent 48ef619 commit a908813
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions superset/viz.py
Expand Up @@ -399,8 +399,11 @@ def cache_key(self, query_obj, **extra):
cache_dict["time_range"] = self.form_data.get("time_range")
cache_dict["datasource"] = self.datasource.uid
cache_dict["extra_cache_keys"] = self.datasource.get_extra_cache_keys(query_obj)
if config["ENABLE_ROW_LEVEL_SECURITY"]:
cache_dict["rls"] = security_manager.get_rls_ids(self.datasource)
cache_dict["rls"] = (
security_manager.get_rls_ids(self.datasource)
if config["ENABLE_ROW_LEVEL_SECURITY"]
else []
)
cache_dict["changed_on"] = self.datasource.changed_on
json_data = self.json_dumps(cache_dict, sort_keys=True)
return hashlib.md5(json_data.encode("utf-8")).hexdigest()
Expand Down

0 comments on commit a908813

Please sign in to comment.