From d61038041d5905ce81edb79fde16fe3373d9ce0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Lu=C3=ADsa?= Date: Sat, 7 Oct 2023 18:19:07 +0000 Subject: [PATCH] minor fix --- backend/app/app/api/api_v1/endpoints/tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/app/app/api/api_v1/endpoints/tests.py b/backend/app/app/api/api_v1/endpoints/tests.py index aa7a173e..301d8a4b 100644 --- a/backend/app/app/api/api_v1/endpoints/tests.py +++ b/backend/app/app/api/api_v1/endpoints/tests.py @@ -51,6 +51,10 @@ def read_UE_distances(*, raise HTTPException(status_code=404, detail="UE not found") if not crud.user.is_superuser(current_user) and (UE.owner_id != current_user.id): raise HTTPException(status_code=400, detail="Not enough permissions") + + if retrieve_ue(supi) == None: + raise HTTPException(status_code=400, detail="The emulation needs to be ongoing") + return retrieve_ue_distances(supi) @@ -66,6 +70,10 @@ def read_UE_losses(*, raise HTTPException(status_code=404, detail="UE not found") if not crud.user.is_superuser(current_user) and (UE.owner_id != current_user.id): raise HTTPException(status_code=400, detail="Not enough permissions") + + if retrieve_ue(supi) == None: + raise HTTPException(status_code=400, detail="The emulation needs to be ongoing") + return retrieve_ue_path_losses(supi) @@ -81,6 +89,10 @@ def read_UE_rsrps(*, raise HTTPException(status_code=404, detail="UE not found") if not crud.user.is_superuser(current_user) and (UE.owner_id != current_user.id): raise HTTPException(status_code=400, detail="Not enough permissions") + + if retrieve_ue(supi) == None: + raise HTTPException(status_code=400, detail="The emulation needs to be ongoing") + return retrieve_ue_rsrps(supi) @router.get("/{supi}/handovers") @@ -95,4 +107,8 @@ def read_UE_handovers(*, raise HTTPException(status_code=404, detail="UE not found") if not crud.user.is_superuser(current_user) and (UE.owner_id != current_user.id): raise HTTPException(status_code=400, detail="Not enough permissions") + + if retrieve_ue(supi) == None: + raise HTTPException(status_code=400, detail="The emulation needs to be ongoing") + return retrieve_ue_handovers(supi) \ No newline at end of file