Dmitry Novikov 7 years ago
parent
commit
5243fda0e6
  1. 6
      taskapp/handle.py

6
taskapp/handle.py

@ -23,7 +23,7 @@ def handle(task, author, recipients):
task_status = _('Task') task_status = _('Task')
# If task completed or failed # If task completed or failed
if task.state == 'F' or task.state == 'C':
if task.state in ('F', 'C'):
task_status = _('Task completed') task_status = _('Task completed')
fulltext = render_to_string('taskapp/notification.html', { fulltext = render_to_string('taskapp/notification.html', {
@ -33,12 +33,12 @@ def handle(task, author, recipients):
}) })
try: try:
if task.state == 'F' or task.state == 'C':
if task.state in ('F', 'C'):
# If task completed or failed than send one message to author # If task completed or failed than send one message to author
send_email_notify.delay(fulltext, author.pk) send_email_notify.delay(fulltext, author.pk)
send_viber_message.delay(None, author.pk, fulltext) send_viber_message.delay(None, author.pk, fulltext)
else: else:
#multicast_email_notify.delay(fulltext, profile_ids)
# multicast_email_notify.delay(fulltext, profile_ids)
multicast_viber_notify.delay(None, profile_ids, fulltext) multicast_viber_notify.delay(None, profile_ids, fulltext)
except OperationalError as e: except OperationalError as e:
raise TaskException(e) raise TaskException(e)
Loading…
Cancel
Save