|
|
|
@ -23,7 +23,7 @@ def handle(task, author, recipients): |
|
|
|
task_status = _('Task') |
|
|
|
|
|
|
|
# If task completed or failed |
|
|
|
if task.state == 'F' or task.state == 'C': |
|
|
|
if task.state in ('F', 'C'): |
|
|
|
task_status = _('Task completed') |
|
|
|
|
|
|
|
fulltext = render_to_string('taskapp/notification.html', { |
|
|
|
@ -33,12 +33,12 @@ def handle(task, author, recipients): |
|
|
|
}) |
|
|
|
|
|
|
|
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 |
|
|
|
send_email_notify.delay(fulltext, author.pk) |
|
|
|
send_viber_message.delay(None, author.pk, fulltext) |
|
|
|
else: |
|
|
|
#multicast_email_notify.delay(fulltext, profile_ids) |
|
|
|
# multicast_email_notify.delay(fulltext, profile_ids) |
|
|
|
multicast_viber_notify.delay(None, profile_ids, fulltext) |
|
|
|
except OperationalError as e: |
|
|
|
raise TaskException(e) |