Do not try to renew OAuthCredentials if they do not have a refresh token
Sentry Issue: ARKINDEX-BACKEND-1C2
HTTPError: 400 Client Error: Bad Request for url: https://gitlab.com/oauth/token
(11 additional frame(s) were not displayed)
...
File "arkindex/process/providers.py", line 128, in _get_project_from_repo
File "arkindex/process/providers.py", line 115, in _get_gitlab_client
File "arkindex/users/providers.py", line 119, in refresh_token
File "arkindex/users/providers.py", line 146, in grant_token
File "requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
An OAuthCredentials
instance had an empty string as the refresh_token
. Refreshing will obviously always fail, and this is what happened during the execution of a GitLab webhook. We should just not try to refresh at all, and crash immediately, setting the credentials' status to error
.