stranck-dev #25

Merged
drew merged 5 commits from stranck-dev into drew-dev 2024-05-13 10:17:12 +00:00
1 changed files with 7 additions and 3 deletions
Showing only changes of commit 938bc68383 - Show all commits

4
ext.py
View File

@ -222,9 +222,13 @@ class Order:
res = await pretixClient.patch(f'orderpositions/{self.position_id}/', json={'answers': self.answers}, expectedStatusCodes=None) res = await pretixClient.patch(f'orderpositions/{self.position_id}/', json={'answers': self.answers}, expectedStatusCodes=None)
if res.status_code != 200: if res.status_code != 200:
e = res.json()
if "answers" in e:
for ans, err in zip(self.answers, res.json()['answers']): for ans, err in zip(self.answers, res.json()['answers']):
if err: if err:
logger.error ('[ANSWERS SENDING] ERROR ON %s %s', ans, err) logger.error ('[ANSWERS SENDING] ERROR ON %s %s', ans, err)
else:
logger.error("[ANSWERS SENDING] GENERIC ERROR. Response: '%s'", str(e))
raise exceptions.ServerError('There has been an error while updating this answers.') raise exceptions.ServerError('There has been an error while updating this answers.')