Skip to content

Commit

Permalink
renaming some params
Browse files Browse the repository at this point in the history
  • Loading branch information
amitmiran137 committed Jun 8, 2021
1 parent ebb1405 commit 16c8a18
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions superset/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,19 @@ def filter_sets_lst(self) -> Dict[int, FilterSet]:
if is_user_admin():
return self._filter_sets
current_user = g.user.id
mapa: Dict[str, List[Any]] = {"Dashboard": [], "User": []}
filter_sets_by_owner_type: Dict[str, List[Any]] = {"Dashboard": [], "User": []}
for fs in self._filter_sets:
mapa[fs.owner_type].append(fs)
rv = list(
filter(lambda filter_set: filter_set.owner_id == current_user, mapa["User"])
filter_sets_by_owner_type[fs.owner_type].append(fs)
user_filter_sets = list(
filter(
lambda filter_set: filter_set.owner_id == current_user,
filter_sets_by_owner_type["User"],
)
)
return {fs.id: fs for fs in rv + mapa["Dashboard"]}
return {
fs.id: fs
for fs in user_filter_sets + filter_sets_by_owner_type["Dashboard"]
}

@property
def table_names(self) -> str:
Expand Down

0 comments on commit 16c8a18

Please sign in to comment.