oncall-engine/engine/apps/email
Michael Derynck 4c1639c944
Fix retrying email notification task (#4772)
# What this PR does
Email tasks are failing and retrying when they use the fallback default
notification policy as it does not get saved in the DB. This PR uses the
same way as UserNotificationPolicyLogRecord to set that field to null to
avoid `ValueError("save() prohibited to prevent data loss due to unsaved
related object 'notification_policy'.").` when that is the case.

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-08-01 14:48:39 +00:00
..
migrations Change email message on_delete to not block organization delete (#2060) 2023-05-31 13:44:55 +00:00
templates Change email templating to not wrap user defined templates (#3862) 2024-02-09 19:03:25 +00:00
tests Fix retrying email notification task (#4772) 2024-08-01 14:48:39 +00:00
__init__.py Restore email notifications (#621) 2022-10-19 12:32:56 +01:00
alert_rendering.py Change email templating to not wrap user defined templates (#3862) 2024-02-09 19:03:25 +00:00
backend.py patch default user notification policy changes + fix failing e2e test (#4635) 2024-07-09 11:23:53 -04:00
inbound.py Handle inbound email integration alert getting multiple recipients (#4655) 2024-07-11 12:51:01 +00:00
models.py Fix retrying email notification task (#4772) 2024-08-01 14:48:39 +00:00
tasks.py Fix retrying email notification task (#4772) 2024-08-01 14:48:39 +00:00