oncall-engine/engine/apps/base/models
Joey Orlando 34a90134fb
patch default user notification policy changes + fix failing e2e test (#4635)
# What this PR does

This is a follow-up PR to https://github.com/grafana/oncall/pull/4628.
As @Ferril pointed out, there was a slight issue in
`apps.alerts.tasks.notify_user.perform_notification` method when using a
"fallback"/default user notification policy. This is because the
`log_record_pk` arg passed into `perform_notification` will fetch the
`UserNotificationPolicyLogRecord` object, but that object will have a
`notification_policy` set to `None` (because there's no persistent
`UserNotificationPolicy` object to refer to).

Instead we now pass in a second argument to `perform_notification`,
`use_default_notification_policy_fallback`. If this is true, simply grab
the transient/in-memory `UserNotificationPolicy` and use that inside of
this task

Related to https://github.com/grafana/oncall/issues/4410

## 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-07-09 11:23:53 -04:00
..
__init__.py Insight logs (#348) 2022-08-24 12:04:44 +05:00
dynamic_setting.py Remove outdated tasks & DynamicSettingsManager (#465) 2022-09-01 17:50:17 +01:00
failed_to_invoke_celery_task.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
live_setting.py add exotel call provider (#4433) 2024-06-06 06:19:02 +00:00
user_notification_policy.py patch default user notification policy changes + fix failing e2e test (#4635) 2024-07-09 11:23:53 -04:00
user_notification_policy_log_record.py patch default user notification policy changes + fix failing e2e test (#4635) 2024-07-09 11:23:53 -04:00