Skip to content

Commit

Permalink
try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Kehl committed Dec 3, 2024
1 parent 14e4d76 commit 9b1eb70
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/celery/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def save_email(
"Email {} failed as restricted service".format(notification_id)
)
return

original_notification = get_notification(notification_id)
try:
saved_notification = persist_notification(
template_id=notification["template"],
Expand All @@ -291,10 +291,11 @@ def save_email(
notification_id=notification_id,
reply_to_text=reply_to_text,
)

provider_tasks.deliver_email.apply_async(
[str(saved_notification.id)], queue=QueueNames.SEND_EMAIL
)
# we only want to send once
if original_notification is None:
provider_tasks.deliver_email.apply_async(
[str(saved_notification.id)], queue=QueueNames.SEND_EMAIL
)

current_app.logger.debug(
"Email {} created at {}".format(
Expand Down

0 comments on commit 9b1eb70

Please sign in to comment.