From 5243fda0e639778eda0cf9136b89a76969a1b578 Mon Sep 17 00:00:00 2001 From: Dmitry Novikov Date: Sun, 14 Jul 2019 15:51:41 +0300 Subject: [PATCH] refa --- taskapp/handle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/taskapp/handle.py b/taskapp/handle.py index 0356b8c..abf3281 100644 --- a/taskapp/handle.py +++ b/taskapp/handle.py @@ -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)