fix(dashboard): import handle missing excluded charts (#19088)

This commit is contained in:
Ville Brofeldt 2022-03-10 12:59:29 +02:00 committed by GitHub
parent bc6aad0a88
commit 999c2c6826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ def update_id_refs( # pylint: disable=too-many-locals
scope_excluded = native_filter.get("scope", {}).get("excluded", [])
if 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

View File

@ -93,7 +93,7 @@ def test_update_native_filter_config_scope_excluded(app_context: None):
},
},
"metadata": {
"native_filter_configuration": [{"scope": {"excluded": [101, 102]}}],
"native_filter_configuration": [{"scope": {"excluded": [101, 102, 103]}}],
},
}
chart_ids = {"uuid1": 1, "uuid2": 2}