Compare commits

..

No commits in common. "76f0eee8412f874a2f65510a6a823aae423c6ec0" and "cb3a501280b14917fd1c594f25521a4979ca20fb" have entirely different histories.

2 changed files with 3 additions and 4 deletions

2
ext.py
View File

@ -162,7 +162,7 @@ class Order:
localHeaders = dict(headers) localHeaders = dict(headers)
localHeaders['Content-Type'] = mimeType localHeaders['Content-Type'] = mimeType
localHeaders['Content-Disposition'] = f'attachment; filename="{fileName}"' localHeaders['Content-Disposition'] = f'attachment; filename="{fileName}"'
res = await pretixClient.post("upload", baseUrl=base_url, headers=localHeaders, content=data, expectedStatusCodes=[201]) res = await pretixClient.post("upload", baseUrl=base_url, headers=localHeaders, content=data)
res = res.json() res = res.json()
await self.edit_answer(name, res['id']) await self.edit_answer(name, res['id'])
else: else:

View File

@ -30,12 +30,11 @@ async def doReq(url, httpxFunc, metricsFunc, expectedStatusCodes, opLogString) -
for requests in range(PRETIX_REQUESTS_MAX): for requests in range(PRETIX_REQUESTS_MAX):
try: try:
metricsFunc() metricsFunc()
res : httpx.Response = await httpxFunc(client) res = await httpxFunc(client)
if expectedStatusCodes is not None and res.status_code not in expectedStatusCodes: if expectedStatusCodes is not None and res.status_code not in expectedStatusCodes:
incPretixErrors() incPretixErrors()
logger.warning(f"[PRETIX] Got an unexpected status code ({res.status_code}) while {opLogString} '{url}'. Allowed status codes: {', '.join(map(str, expectedStatusCodes))}") logger.warning(f"[PRETIX] Got an unexpected status code ({res.status_code}) while {opLogString} '{url}'. Allowed status codes: {', '.join(expectedStatusCodes)}")
logger.debug(f"Response: '{res.text}'")
continue continue
break break
except Exception as e: except Exception as e: