Skip to content

Commit

Permalink
Dev (#22)
Browse files Browse the repository at this point in the history
* Adding digest_unanalyzed route + debug Operation being linked to Readset when ingesting transfer and GenPipes

* Debug missing arg

* Using project rather than project_name or project_id in routes - test 1

* Adding project converter/checker

* Debug pytest

* Adding if to avoid failure if project_name in json set to null

* Small fix

* Need to convert project_id from name_to_id from list of int into str
  • Loading branch information
paulstretenowich authored Nov 10, 2023
1 parent 679ee3d commit 70b1a48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions project_tracking/api/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def wrap(*args, project=None, **kwargs):
all_available = [f"id: {project.id}, name: {project.name}" for project in db_action.projects()]
project_id = {"DB_ACTION_WARNING": f"Requested Project '{project}' doesn't exist. Please try again with one of the following: {all_available}"}
else:
project_id = db_action.name_to_id("Project", project.upper())
project_id = str(db_action.name_to_id("Project", project.upper())[0])
if not project_id:
all_available = [f"id: {project.id}, name: {project.name}" for project in db_action.projects()]
project_id = {"DB_ACTION_WARNING": f"Requested Project '{project}' doesn't exist. Please try again with one of the following: {all_available}"}
Expand Down Expand Up @@ -454,7 +454,7 @@ def ingest_run_processing(project_id: str):


if ingest_data[vc.PROJECT_NAME]:
project_id_from_name = db_action.name_to_id("Project", ingest_data[vc.PROJECT_NAME].upper())
project_id_from_name = str(db_action.name_to_id("Project", ingest_data[vc.PROJECT_NAME].upper())[0])
if project_id != project_id_from_name:
return {"DB_ACTION_WARNING": f"Requested Project {project_id_from_name} in the input json is not matching the Project in the route {project_id}"}

Expand Down Expand Up @@ -507,7 +507,7 @@ def ingest_genpipes(project_id: str):


if ingest_data[vc.PROJECT_NAME]:
project_id_from_name = db_action.name_to_id("Project", ingest_data[vc.PROJECT_NAME].upper())
project_id_from_name = str(db_action.name_to_id("Project", ingest_data[vc.PROJECT_NAME].upper())[0])
if project_id != project_id_from_name:
return {"DB_ACTION_WARNING": f"Requested Project {project_id_from_name} in the input json is not matching the Project in the route {project_id}"}

Expand Down

0 comments on commit 70b1a48

Please sign in to comment.