fix(dashboard): import handle missing excluded charts (#19088)
This commit is contained in:
parent
bc6aad0a88
commit
999c2c6826
|
|
@ -137,7 +137,7 @@ def update_id_refs( # pylint: disable=too-many-locals
|
||||||
scope_excluded = native_filter.get("scope", {}).get("excluded", [])
|
scope_excluded = native_filter.get("scope", {}).get("excluded", [])
|
||||||
if scope_excluded:
|
if scope_excluded:
|
||||||
native_filter["scope"]["excluded"] = [
|
native_filter["scope"]["excluded"] = [
|
||||||
id_map[old_id] for old_id in scope_excluded
|
id_map[old_id] for old_id in scope_excluded if old_id in id_map
|
||||||
]
|
]
|
||||||
|
|
||||||
return fixed
|
return fixed
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ def test_update_native_filter_config_scope_excluded(app_context: None):
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"native_filter_configuration": [{"scope": {"excluded": [101, 102]}}],
|
"native_filter_configuration": [{"scope": {"excluded": [101, 102, 103]}}],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
chart_ids = {"uuid1": 1, "uuid2": 2}
|
chart_ids = {"uuid1": 1, "uuid2": 2}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue