diff --git a/grafana_dashboards/components/templates.py b/grafana_dashboards/components/templates.py index 1d2066d..261c679 100644 --- a/grafana_dashboards/components/templates.py +++ b/grafana_dashboards/components/templates.py @@ -121,11 +121,11 @@ def gen_json_from_data(self, data, context): 'value': '$__all' if data['current'] == 'All' else data['current'] } if 'options' in data: - template_json['options'] = [{'text': option, 'value': option} for option + template_json['options'] = [{'text': option, 'value': option} for option in (data['options'])] - if 'includeAll' in data and data['includeAll'] == True: + if 'includeAll' in data and data['includeAll'] is True: all_option = {'selected': True, 'text': 'All', 'value': '$__all'} - template_json.setdefault('options', []).insert(0,all_option) + template_json.setdefault('options', []).insert(0, all_option) return template_json