Always format notification subject
This commit is contained in:
@@ -1052,7 +1052,16 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None,
|
|||||||
logger.error(u"Tautulli NotificationHandler :: Unable to parse custom script arguments: %s. Using fallback." % e)
|
logger.error(u"Tautulli NotificationHandler :: Unable to parse custom script arguments: %s. Using fallback." % e)
|
||||||
script_args = []
|
script_args = []
|
||||||
|
|
||||||
elif agent_id == 25:
|
try:
|
||||||
|
subject = custom_formatter.format(unicode(subject), **parameters)
|
||||||
|
except LookupError as e:
|
||||||
|
logger.error(u"Tautulli NotificationHandler :: Unable to parse parameter %s in notification subject. Using fallback." % e)
|
||||||
|
subject = unicode(default_subject).format(**parameters)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(u"Tautulli NotificationHandler :: Unable to parse custom notification subject: %s. Using fallback." % e)
|
||||||
|
subject = unicode(default_subject).format(**parameters)
|
||||||
|
|
||||||
|
if agent_id == 25:
|
||||||
if body:
|
if body:
|
||||||
try:
|
try:
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
@@ -1076,15 +1085,6 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None,
|
|||||||
body = ''
|
body = ''
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
|
||||||
subject = custom_formatter.format(unicode(subject), **parameters)
|
|
||||||
except LookupError as e:
|
|
||||||
logger.error(u"Tautulli NotificationHandler :: Unable to parse parameter %s in notification subject. Using fallback." % e)
|
|
||||||
subject = unicode(default_subject).format(**parameters)
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(u"Tautulli NotificationHandler :: Unable to parse custom notification subject: %s. Using fallback." % e)
|
|
||||||
subject = unicode(default_subject).format(**parameters)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
body = custom_formatter.format(unicode(body), **parameters)
|
body = custom_formatter.format(unicode(body), **parameters)
|
||||||
except LookupError as e:
|
except LookupError as e:
|
||||||
|
Reference in New Issue
Block a user