Skip to content

Commit

Permalink
Fixed edge case when template not associated with notification obj
Browse files Browse the repository at this point in the history
  • Loading branch information
jimleroyer committed Dec 7, 2023
1 parent d064161 commit c3e5ee6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/celery/provider_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _handle_error_with_email_retry(
else:
current_app.logger.exception("RETRY: Email notification {} failed".format(notification_id), exc_info=e)
# There is an edge case when a notification is not found in the database.
if notification is None:
if notification is None or notification.template is None:
task.retry(**CeleryParams.retry(countdown=countdown))
else:
task.retry(**CeleryParams.retry(notification.template.process_type, countdown))
Expand Down

0 comments on commit c3e5ee6

Please sign in to comment.