From dea7b3660aec5349468c8a83d59326a06aab03d3 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 28 Sep 2020 12:48:53 +0100 Subject: [PATCH] Minor formatting cleanups --- plugins/eddn.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index 238a5e18..d3df791a 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -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: []"): + and r.text == "FAIL: []" + ): 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()