oncall-engine/engine/apps/mobile_app/migrations
Joey Orlando 572131b921
add user locale field to mobile app user settings table + change going on call push notification text (#2131)
# What this PR does

- add user locale field to mobile app user settings table + add a test
that sends `PATCH` requests to this endpoint
- change "you're going on call" push notification text to include
localized shift time. The general format is now:
  ```python
f"You're going on call in {time_until_going_oncall} for schedule
{schedule.name}, {formatted_shift}"
  ```
- `time_until_going_oncall` is a "human-readable" format of the time
until the start)
  - `schedule.name` is self-explanatory
- `formatted_shift` this depends on the shift. If the shift starts and
ends on the same day, the format will be "HH:mm - HH:mm". Otherwise, if
the shift starts and ends on different days, the format will be
"YYYY-MM-DD HH:mm - YYYY-MM-DD HH:mm". **Note** that all datetime
related formatting will use the new `locale` field that we are now
storing in the mobile app user settings table. If no locale is yet
present we will fallback to "en"

## Which issue(s) this PR fixes

closes https://github.com/grafana/oncall/issues/2024
https://github.com/grafana/oncall-mobile-app/issues/187

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-14 12:19:58 -04:00
..
0001_initial.py Add database migrations linter (#1020) 2023-02-06 16:01:37 +08:00
0002_alter_mobileappauthtoken_user.py add unique idx on user column in mobileapp authtoken table (#1482) 2023-03-08 13:50:57 +01:00
0003_mobileappusersettings.py Mobile app settings backend (#1571) 2023-03-22 14:47:18 +00:00
0004_auto_20230425_1033.py "You're Going OnCall" mobile app push notification (#1814) 2023-05-04 16:59:57 +00:00
0005_mobileappusersettings_important_notification_volume_override.py add important_notification_volume_override to mobile app user settings model (#1893) 2023-05-09 14:28:47 +00:00
0006_auto_20230512_0902.py add user settings for info notifications (#1926) 2023-05-12 10:23:42 +00:00
0007_alter_mobileappusersettings_info_notifications_enabled.py Disable "You're going OnCall soon" push notification (#1927) 2023-05-12 11:56:12 +00:00
0008_mobileappusersettings_locale.py add user locale field to mobile app user settings table + change going on call push notification text (#2131) 2023-06-14 12:19:58 -04:00
__init__.py Mobile app messaging backend (#874) 2022-11-23 15:56:43 +00:00