Add blank defaults to conditions and parameters

This commit is contained in:
JonnyWong16 2017-05-06 22:43:49 -07:00
parent 42b1a0d3de
commit 2e83b42ba9
2 changed files with 12 additions and 6 deletions

View file

@ -2950,10 +2950,16 @@ class WebInterface(object):
def get_notifier_config_modal(self, notifier_id=None, **kwargs):
result = notifiers.get_notifier_config(notifier_id=notifier_id)
parameters = [
{'name': param['name'], 'type': param['type'], 'value': param['value']}
for category in common.NOTIFICATION_PARAMETERS
for param in category['parameters']
if not result['custom_conditions']:
result['custom_conditions'] = json.dumps([{'coefficient': '', 'operator': '', 'value': ''}])
if not result['custom_conditions_logic']:
result['custom_conditions_logic'] = ''
parameters = [{'name': '', 'type': '', 'value': ''}]
parameters += [
{'name': param['name'], 'type': param['type'], 'value': param['value']}
for category in common.NOTIFICATION_PARAMETERS for param in category['parameters']
]
return serve_template(templatename="notifier_config.html", notifier=result, parameters=json.dumps(parameters))