Add feature for notifications to trigger on job start

This commit is contained in:
beeankha
2019-05-31 13:46:45 -04:00
parent 049b3a2e87
commit 8ec97235e3
18 changed files with 117 additions and 9 deletions

View File

@@ -314,7 +314,7 @@ def send_notifications(notification_list, job_id=None):
update_fields = ['status', 'notifications_sent']
try:
sent = notification.notification_template.send(notification.subject, notification.body)
notification.status = "successful"
notification.status = "successful" or "running"
notification.notifications_sent = sent
except Exception as e:
logger.error("Send Notification Failed {}".format(e))
@@ -1115,6 +1115,8 @@ class BaseTask(object):
self.instance = self.update_model(pk, status='running',
start_args='') # blank field to remove encrypted passwords
self.instance.send_notification_templates("running")
self.instance.websocket_emit_status("running")
status, rc = 'error', None
extra_update_fields = {}