From 29dd778d4241efc94402d0a3314e2cb9b6020317 Mon Sep 17 00:00:00 2001 From: Azzouz-Thuderoz Date: Wed, 17 Jan 2024 17:52:14 +0100 Subject: [PATCH] fixing error in the workflow regarding writeOai.py --- src/zbmath_rest2oai/writeOai.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/zbmath_rest2oai/writeOai.py b/src/zbmath_rest2oai/writeOai.py index 0d4c91b..fe9cc01 100644 --- a/src/zbmath_rest2oai/writeOai.py +++ b/src/zbmath_rest2oai/writeOai.py @@ -29,11 +29,10 @@ def write_oai(x): #x = requests.post("http://localhost:8081/oai-backend/item", files=files) basic = HTTPBasicAuth('swmath', os.environ.get('OAI_BASIC_PASSWORD')) x = requests.post("http://oai-input.portal.mardi4nfdi.de/oai-backend/item", files=files , auth=basic) - if r.status_code != 200: - raise Exception(f"Unexpected response with status code {r.status_code}: {r.text}") + if x.status_code != 200: + raise Exception(f"Unexpected response with status code {x.status_code}: {x.text}") else: - return - print(x.text) + return x.text # x = requests.get('http://localhost:8081/oai-backend/item/10.5072%2F38236')