oncall-engine/engine/apps/api/serializers
Matias Bordese 6e5d417967
Update shift week_start when translating to UTC (#2124)
This fixes scenario described
[here](https://github.com/grafana/oncall/issues/2118#issuecomment-1580499754).

When a rotation is setup in UTC+1, and the shift starts at 00:00 with
Monday as active day and a weekly frequency, the values are translated
to UTC when submitting to the backend, so the shift data becomes
something like: shift starting at 23:00 on Sunday, but since week_start
is on Monday, the "first event" in the week belongs to the "previous
week". This can be addressed by moving the week_start, so a weekly shift
that was starting on a Monday but in UTC tz starts on Sunday,
"translates" to a UTC week_start on Sunday:


![rotation-example](https://github.com/grafana/oncall/assets/260710/5222d3ce-52b7-41d5-8ecb-d01c7a0139cb)


(this is with the proposed changes; otherwise you get the same issue
linked above where the first event in the week is assigned to the other
user group).

About selected week days changed when editing a rotation, see inline
comment (related to
[this](https://github.com/grafana/oncall/issues/1322#issuecomment-1521787786))
2023-06-13 14:31:50 +00:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert.py add several new database columns + emit two new Django signals (#1522) 2023-04-14 09:15:57 +02:00
alert_group.py add channel__team to internal api serializer select_related (#1805) 2023-04-20 18:30:49 +02:00
alert_receive_channel.py Fix demo-payload (#2139) 2023-06-08 23:31:18 +08:00
alerts_field_cache_buster_mixin.py add several new database columns + emit two new Django signals (#1522) 2023-04-14 09:15:57 +02:00
channel_filter.py Added preview and migration API endpoints for route migration from regex into jinja2 (#1715) 2023-04-18 02:53:53 +00:00
custom_button.py use CustomURLValidator in custom_button (#1398) 2023-03-23 12:21:17 +00:00
custom_serializers.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
escalation_chain.py Add alert group filter by escalation chain (#1535) 2023-03-14 14:38:18 +00:00
escalation_policy.py add mypy static type checker to backend codebase (#2151) 2023-06-12 12:50:33 -04:00
integration_heartbeat.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
live_setting.py Allow no-auth SMTP connection for email notifications (#759) 2022-11-03 16:18:37 +00:00
on_call_shifts.py Update shift week_start when translating to UTC (#2124) 2023-06-13 14:31:50 +00:00
organization.py add mypy static type checker to backend codebase (#2151) 2023-06-12 12:50:33 -04:00
organization_slack_settings.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
paging.py Teams redesign (#1528) 2023-03-22 00:57:20 +08:00
public_api_token.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
resolution_note.py Optimize alert group list view (#299) 2022-07-27 14:14:59 +03:00
schedule_base.py Add support for web overrides to Terraform schedules (#1222) 2023-03-10 16:21:50 +00:00
schedule_calendar.py Add support for web overrides to Terraform schedules (#1222) 2023-03-10 16:21:50 +00:00
schedule_ical.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
schedule_polymorphic.py add mypy static type checker to backend codebase (#2151) 2023-06-12 12:50:33 -04:00
schedule_reminder.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
schedule_web.py Add support for web overrides to Terraform schedules (#1222) 2023-03-10 16:21:50 +00:00
slack_channel.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
slack_user_identity.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
team.py Teams redesign (#1528) 2023-03-22 00:57:20 +08:00
telegram.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
user.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
user_group.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
user_notification_policy.py add mypy static type checker to backend codebase (#2151) 2023-06-12 12:50:33 -04:00
webhook.py Webhooks 2 hide secrets (#2104) 2023-06-06 07:59:12 +00:00