1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 01:22:19 +03:00

Minor formatting cleanups

This commit is contained in:
Athanasius 2020-09-28 12:48:53 +01:00
parent e908cce242
commit dea7b3660a

View File

@ -142,20 +142,23 @@ class EDDN:
if r.status_code != requests.codes.ok:
# Check if EDDN is still objecting to an empty commodities list
if (r.status_code == 400
if (
r.status_code == 400
and msg['$schemaRef'] == 'https://eddn.edcd.io/schemas/commodity/3'
and msg['message']['commodities'] == []
and r.text == "FAIL: [<ValidationError: '[] is too short'>]"):
and r.text == "FAIL: [<ValidationError: '[] is too short'>]"
):
logger.trace("EDDN is still objecting to empty commodities data")
return # We want to silence warnings otherwise
logger.debug(f'''Status from POST wasn't OK:
logger.debug(
f'''Status from POST wasn't OK:
Status\t{r.status_code}
URL\t{r.url}
Headers\t{r.headers}
Content:\n{r.text}
Msg:\n{msg}'''
)
)
r.raise_for_status()