From c07a4ff93d351a9b127f40745394c3b5b344fd71 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Sat, 16 Sep 2017 09:58:04 -0400 Subject: [PATCH] Catch any unhandled exceptions grabbing notification templates --- awx/main/tasks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 6753fb8577..459b296d5c 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -316,7 +316,11 @@ def awx_periodic_scheduler(self): def _send_notification_templates(instance, status_str): if status_str not in ['succeeded', 'failed']: raise ValueError(_("status_str must be either succeeded or failed")) - notification_templates = instance.get_notification_templates() + try: + notification_templates = instance.get_notification_templates() + except: + logger.warn("No notification template defined for emitting notification") + notification_templates = None if notification_templates: if status_str == 'succeeded': notification_template_type = 'success'