Skip to content

Commit

Permalink
Don't send email alerts for task validation messages.
Browse files Browse the repository at this point in the history
-----------------------
This commit does the following:
- Task validation messages are not sent over emails. They are always saved on database (i.e. These messages are displayed on TM notification pages.)
- Task invalidation messages are always saved on database (i.e Can be viewed on TM notification page). Task invalidation messages will be sent over email if user has enabled `task notification` email.
- Task notification setting (Task validation emails on frontend) will only control if task invalidation message is sent over email)
  • Loading branch information
Aadesh-Baral committed Jul 3, 2023
1 parent 7a5e268 commit ffb2269
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backend/services/messaging/message_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,13 @@ def _push_messages(messages):
and obj.message_type == MessageType.TASK_COMMENT_NOTIFICATION.value
):
continue
if user.tasks_notifications is False and obj.message_type in (
MessageType.VALIDATION_NOTIFICATION.value,
MessageType.INVALIDATION_NOTIFICATION.value,
# Don't send email alerts for task validation messages
if obj.message_type == MessageType.VALIDATION_NOTIFICATION.value:
messages_objs.append(obj)
continue
if (
user.tasks_notifications is False
and obj.message_type == MessageType.INVALIDATION_NOTIFICATION.value
):
messages_objs.append(obj)
continue
Expand Down

0 comments on commit ffb2269

Please sign in to comment.