oncall-engine/engine/apps/api
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
..
serializers Update shift week_start when translating to UTC (#2124) 2023-06-13 14:31:50 +00:00
tests Update shift week_start when translating to UTC (#2124) 2023-06-13 14:31:50 +00:00
throttlers Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00
views add mypy static type checker to backend codebase (#2151) 2023-06-12 12:50:33 -04:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
errors.py Fix backend for resolution notes via mobile app (#2117) 2023-06-07 12:19:16 +00:00
permissions.py add mypy static type checker to backend codebase (#2151) 2023-06-12 12:50:33 -04:00
response_renderers.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
urls.py Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00