mirror of
https://github.com/uw935/vatsimfox.git
synced 2026-09-17 05:59:04 +00:00
fix: 404 error
This commit is contained in:
+5
-2
@@ -61,10 +61,13 @@ async def get_viewer_page(request: Request, cid: str = None):
|
|||||||
:param cid: User CID
|
:param cid: User CID
|
||||||
:return: HTML template
|
:return: HTML template
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
|
user = requests.get(f"{VATSIM_API_URL}members/{cid}").json()
|
||||||
|
except requests.exceptions.JSONDecodeError:
|
||||||
|
raise HTTPException(404)
|
||||||
|
|
||||||
user = requests.get(f"{VATSIM_API_URL}members/{cid}").json()
|
|
||||||
if "detail" in user and user["detail"] == "Not Found":
|
if "detail" in user and user["detail"] == "Not Found":
|
||||||
return HTTPException(404)
|
raise HTTPException(404)
|
||||||
|
|
||||||
return templates.TemplateResponse(
|
return templates.TemplateResponse(
|
||||||
name="viewer.html",
|
name="viewer.html",
|
||||||
|
|||||||
Reference in New Issue
Block a user