]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 20 May 2023 05:28:08 +0000 (07:28 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 20 May 2023 05:28:08 +0000 (07:28 +0200)
- copy-paste mistake fixed
- it must be 'port'

api.py

diff --git a/api.py b/api.py
index df4c1f8d26ca06fe17194756a4f92d187f5384bc..2f94925467d23aca1aea03a4a7910cce4fadd7a8 100644 (file)
--- a/api.py
+++ b/api.py
@@ -85,13 +85,13 @@ def index(request: Request, blockers: int = None, blocked: int = None):
     if blockers == None and blocked == None:
         raise HTTPException(status_code=400, detail="No filter specified")
     elif blockers != None:
-        scores = get(f"http://127.0.0.1:{fba.config['base_url']}{fba.config['base_url']}/top?blockers={blockers}")
+        scores = get(f"http://127.0.0.1:{fba.config['port']}{fba.config['base_url']}/top?blockers={blockers}")
     elif blocked != None:
         scores = get(f"http://127.0.0.1:{fba.config['port']}{fba.config['base_url']}/top?blocked={blocked}")
 
     if scores != None:
         if not scores.ok:
-            raise HTTPException(status_code=blocks.status_code, detail=blocks.text)
+            raise HTTPException(status_code=scores.status_code, detail=scores.text)
 
         scores = scores.json()