oncall-engine/engine/apps/user_management
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
..
migrations Fix team uniqueness db migration (#4416) 2024-05-28 19:41:42 +00:00
models patch default user notification policy changes + fix failing e2e test (#4635) 2024-07-09 11:23:53 -04:00
subscription_strategy Speed up send email notification task (#3713) 2024-01-18 13:54:18 +00:00
tests don't force create default user notification policies (#4608) 2024-07-05 15:08:17 -04:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
apps.py Update ical event/user email matching to be case-insensitive 2022-10-20 16:12:41 -03:00
constants.py Google OAuth2 flow + fetch Google Calendar OOO events (#4067) 2024-04-02 14:59:03 -04:00
exceptions.py Org soft-delete (#1073) 2023-01-05 12:42:55 +08:00
middlewares.py Handle Amazon SNS headers for moved (#3371) 2023-11-16 13:44:56 -07:00
signals.py add several new database columns + emit two new Django signals (#1522) 2023-04-14 09:15:57 +02:00
sync.py remove deprecated rbac workaround (#4377) 2024-05-22 15:27:16 +00:00
types.py Google OAuth2 flow + fetch Google Calendar OOO events (#4067) 2024-04-02 14:59:03 -04:00
user_representative.py apps.get_model -> import (#2619) 2023-07-25 09:43:23 +00:00