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

@ -208,13 +208,7 @@ def notify_custom_conditions(notifier_id=None, parameters=None):
notifier_config = notifiers.get_notifier_config(notifier_id=notifier_id)
custom_conditions_logic = notifier_config['custom_conditions_logic']
try:
custom_conditions = json.loads(notifier_config['custom_conditions']) or []
except ValueError as e:
logger.error(u"Tautulli NotificationHandler :: Unable to parse custom condition: %s." % e)
logger.debug(u"Tautulli NotificationHandler :: Custom conditions json: %s "
% notifier_config['custom_conditions'])
custom_conditions = []
custom_conditions = notifier_config['custom_conditions']
if custom_conditions_logic or any(c for c in custom_conditions if c['value']):
logger.debug(u"Tautulli NotificationHandler :: Checking custom notification conditions for notifier_id %s."