Skip to content

Commit

Permalink
Save empty label_colors
Browse files Browse the repository at this point in the history
  • Loading branch information
geido committed Nov 17, 2021
1 parent c54027a commit c2de7e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions superset/dashboards/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def get_dashboard_and_datasets_changed_on( # pylint: disable=invalid-name
def validate_slug_uniqueness(slug: str) -> bool:
if not slug:
return True
dashboard_query = db.session.query(Dashboard).filter(Dashboard.slug == slug)
dashboard_query = db.session.query(
Dashboard).filter(Dashboard.slug == slug)
return not db.session.query(dashboard_query.exists()).scalar()

@staticmethod
Expand Down Expand Up @@ -187,7 +188,8 @@ def set_dash_metadata(
]

session = db.session()
current_slices = session.query(Slice).filter(Slice.id.in_(slice_ids)).all()
current_slices = session.query(Slice).filter(
Slice.id.in_(slice_ids)).all()

dashboard.slices = current_slices

Expand Down Expand Up @@ -241,10 +243,9 @@ def set_dash_metadata(
}
md["default_filters"] = json.dumps(applicable_filters)
md["color_scheme"] = data.get("color_scheme")
md["label_colors"] = data.get("label_colors")
if data.get("color_namespace"):
md["color_namespace"] = data.get("color_namespace")
if data.get("label_colors"):
md["label_colors"] = data.get("label_colors")
dashboard.json_metadata = json.dumps(md)

@staticmethod
Expand Down

0 comments on commit c2de7e2

Please sign in to comment.