Attempt at fixing custom condition json error

This commit is contained in:
JonnyWong16 2018-03-13 22:16:23 -07:00
parent b5c52ac71e
commit 87d2d273d3
4 changed files with 20 additions and 21 deletions

View file

@ -3004,18 +3004,12 @@ class WebInterface(object):
def get_notifier_config_modal(self, notifier_id=None, **kwargs):
result = notifiers.get_notifier_config(notifier_id=notifier_id)
if not result['custom_conditions']:
result['custom_conditions'] = json.dumps([{'parameter': '', 'operator': '', 'value': ''}])
if not result['custom_conditions_logic']:
result['custom_conditions_logic'] = ''
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))
return serve_template(templatename="notifier_config.html", notifier=result, parameters=parameters)
@cherrypy.expose
@cherrypy.tools.json_out()