oncall-engine/engine/apps/social_auth
Joey Orlando 3fd9a73a52
GCal autogenerated shift swap requests - don't recreate if one was previously created and deleted (#4281)
# What this PR does

Addresses two issues:
- addresses an internal feature request ([in
Slack](https://raintank-corp.slack.com/archives/C03KS498VGV/p1713550543916289?thread_ts=1713546008.831749&cid=C03KS498VGV))
to not have a new shift swap request auto-generated if one previously
was, but than the user decided to delete that SSR
- when disconnecting the GCal integration from your user, I've seen
cases where Google will return HTTP 400 as such ([example
logs](https://ops.grafana-ops.net/goto/8vX76pBSg?orgId=1)):
  ```
{'error': 'invalid_token', 'error_description': 'Token expired or
revoked'}
  ```
I can't seem to find detailed documentation on the revoke endpoint (`GET
https://accounts.google.com/o/oauth2/revoke?token=<token>`) to try and
better understand the possible `error` values.. but I think our best bet
here is to just continue forward w/
`user.finish_google_oauth2_disconnection_flow()` (which deletes the
`GoogleOAuth2User` associated with the user and sets
`user.google_calendar_settings = None`)

## 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-04-25 18:16:42 +00:00
..
pipeline GCal autogenerated shift swap requests - don't recreate if one was previously created and deleted (#4281) 2024-04-25 18:16:42 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
backends.py Google OAuth2 flow + fetch Google Calendar OOO events (#4067) 2024-04-02 14:59:03 -04:00
exceptions.py Slack team connector v2 (#1581) 2023-03-28 03:27:45 +00:00
live_setting_django_strategy.py Upgrade to django 4.2.6 and other deps updates (#3176) 2023-10-27 18:45:00 +00:00
middlewares.py Social auth exception logging (#2041) 2023-06-02 11:20:54 +00:00
types.py Google OAuth2 flow + fetch Google Calendar OOO events (#4067) 2024-04-02 14:59:03 -04:00