From 8fe2506577cd3eeb3332450c94ac1b65cf81e675 Mon Sep 17 00:00:00 2001 From: Sam Roberts <sam.roberts@geant.org> Date: Mon, 14 Oct 2024 14:05:39 +0100 Subject: [PATCH] changes made based on feedback --- brian_dashboard_manager/grafana/provision.py | 4 ++-- brian_dashboard_manager/templating/helpers.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/brian_dashboard_manager/grafana/provision.py b/brian_dashboard_manager/grafana/provision.py index d4c17fa..24e96aa 100644 --- a/brian_dashboard_manager/grafana/provision.py +++ b/brian_dashboard_manager/grafana/provision.py @@ -239,9 +239,9 @@ def provision_folder(token_request, folder_name, dash, services, regions, customers = [] region_lookup = {region['nren']: region['region'] for region in regions} for service in services: - service_customers = service.get('customers') + service_customers = service.get('customers', []) for cust in service_customers: - cust_region = region_lookup.get(cust, None) + cust_region = region_lookup.get(cust) if cust_region == region: customers.append(cust) return customers diff --git a/brian_dashboard_manager/templating/helpers.py b/brian_dashboard_manager/templating/helpers.py index 3621734..01d1528 100644 --- a/brian_dashboard_manager/templating/helpers.py +++ b/brian_dashboard_manager/templating/helpers.py @@ -240,7 +240,7 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards, region_cu aggregate_interfaces = dict() for service in services: - _customers = service.get('customers') + _customers = service.get('customers', []) for cust in _customers: if cust.lower() in excluded_dashboards: continue -- GitLab