Skip to content

Commit b159f8b

Browse files
committed
address comments
1 parent c4afe8c commit b159f8b

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

src/argowrapper/routes/routes.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from argowrapper import logger
2323
from argowrapper.auth import Auth
2424
from argowrapper.engine.argo_engine import ArgoEngine
25-
from argowrapper.utils import get_team_cohort_id
25+
from argowrapper.auth.utils import get_cohort_ids_for_team_project
2626

2727
import argowrapper.engine.helpers.argo_engine_helper as argo_engine_helper
2828

@@ -175,7 +175,9 @@ def wrapper(*args, **kwargs):
175175

176176
if team_project and source_id and len(team_project) > 0 and len(cohort_ids) > 0:
177177
# Get team project cohort ids
178-
team_cohort_id_set = get_team_cohort_id(token, source_id, team_project)
178+
team_cohort_id_set = get_cohort_ids_for_team_project(
179+
token, source_id, team_project
180+
)
179181

180182
logger.debug("cohort ids are " + " ".join(str(c) for c in cohort_ids))
181183
logger.debug(
@@ -194,7 +196,7 @@ def wrapper(*args, **kwargs):
194196
)
195197
return HTMLResponse(
196198
content="Cohort ids submitted do NOT all belong to the same team project.",
197-
status_code=HTTP_401_UNAUTHORIZED,
199+
status_code=HTTP_400_BAD_REQUEST,
198200
)
199201

200202
else:

src/argowrapper/utils.py

-24
This file was deleted.

test/test_routes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -655,4 +655,4 @@ def test_submit_workflow_with_non_team_project_cohort(client):
655655
"Authorization": EXAMPLE_AUTH_HEADER,
656656
},
657657
)
658-
assert response.status_code == 401
658+
assert response.status_code == 400

0 commit comments

Comments
 (0)