diff --git a/django_selectel_storage/selectel.py b/django_selectel_storage/selectel.py index f1749e0..ddff000 100644 --- a/django_selectel_storage/selectel.py +++ b/django_selectel_storage/selectel.py @@ -76,6 +76,10 @@ def perform_request(self, http_method, key, self.build_url(key), **kwargs ) # type: requests.Response + if resp.status_code == 401: + log.debug('Got an unexpected 401 error, reauthenticate.') + self.authenticate() + return self.perform_request(http_method, key, raise_exception, **kwargs) if raise_exception: resp.raise_for_status() return resp