Skip to content

Commit 436b005

Browse files
committed
Merge changes from #84 to API v1
1 parent fb57423 commit 436b005

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sdcclient/_monitor_v1.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ def create_dashboard_from_template(self, dashboard_name, template, scope, shared
6060
if chart['overrideFilter'] == False:
6161
# patch frontend bug to hide scope override warning even when it's not really overridden
6262
chart['scope'] = scope
63-
63+
6464
# if chart scope is equal to dashboard scope, set it as non override
65-
chart['overrideFilter'] = chart['scope'] != scope
65+
chart_scope = chart['scope'] if 'scope' in chart else None
66+
chart['overrideFilter'] = chart_scope != scope
6667

6768
if 'annotations' in template:
6869
template['annotations'].update(annotations)
@@ -269,6 +270,7 @@ def remove_dashboard_panel(self, dashboard, panel_name):
269270
#
270271
def filter_fn(panel):
271272
return panel['name'] == panel_name
273+
272274
panels = list(filter(filter_fn, dashboard_configuration['items']))
273275

274276
if len(panels) > 0:

0 commit comments

Comments
 (0)