plone rest api: do not send emails on token request errors (#78535)
gitea/passerelle/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2023-06-15 08:41:07 +02:00
parent c8fb63fe3e
commit 2618463abb
1 changed files with 2 additions and 1 deletions

View File

@ -167,7 +167,8 @@ class PloneRestApi(BaseResource, HTTPResource):
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
}
response = self.requests.post(self.token_ws_url, headers=headers, data=payload)
with self.logger.disable_admin_emails():
response = self.requests.post(self.token_ws_url, headers=headers, data=payload)
if not response.status_code // 100 == 2:
raise APIError(response.content)
token = response.json().get('id_token')