From 454999a895a154fbddd720afee4f49ee8acc0649 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 12 Jun 2024 11:08:28 +0200 Subject: views: skip non-200 OK requests to servers Update multi_request() to skip non-200 OK requests to servers, otherwise traceback is displayed while trying to access the json body. --- ogcp/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ogcp/views.py b/ogcp/views.py index bd74515..1e2cfac 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -241,6 +241,9 @@ def multi_request(method, uri, payload=None): if not r: continue + if r.status_code != requests.codes.ok: + continue + response['server'] = server response['json'] = r.json() responses.append(response) -- cgit v1.2.3-18-g5258