summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-06-12 11:08:28 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-06-12 11:08:53 +0200
commit454999a895a154fbddd720afee4f49ee8acc0649 (patch)
treed7e63a48fca045779eaa598380f2590022846054
parent95b2e2001541a9cf655cab07b0c9062ce26214c0 (diff)
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.
-rw-r--r--ogcp/views.py3
1 files changed, 3 insertions, 0 deletions
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)