Skip to content

Commit 6f40589

Browse files
committed
fix bug to include source population cohort
1 parent 029fd68 commit 6f40589

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/argowrapper/routes/routes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def wrapper(*args, **kwargs):
171171
cohort_ids.extend(v["cohort_ids"])
172172

173173
if "source_population_cohort" in request_body:
174-
cohort_ids.extend(request_body["source_population_cohort"])
174+
cohort_ids.append(request_body["source_population_cohort"])
175175

176176
if team_project and source_id and len(team_project) > 0 and len(cohort_ids) > 0:
177177
header = {"Authorization": token, "cookie": "fence={}".format(token)}

test/test_routes.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"source_id": 4,
3434
"case_cohort_definition_id": 70,
3535
"control_cohort_definition_id": -1,
36+
"source_population_cohort": 4,
3637
"workflow_name": "wf_name",
3738
TEAM_PROJECT_FIELD_NAME: "dummy-team-project",
3839
"user_tags": None, # For testing purpose
@@ -43,6 +44,7 @@
4344
{"cohort_definition_id": 1, "cohort_name": "Cohort 1", "size": 1},
4445
{"cohort_definition_id": 2, "cohort_name": "Cohort 2", "size": 2},
4546
{"cohort_definition_id": 3, "cohort_name": "Cohort 3", "size": 3},
47+
{"cohort_definition_id": 4, "cohort_name": "Cohort 4", "size": 4},
4648
]
4749
}
4850

@@ -643,7 +645,7 @@ def test_submit_workflow_with_non_team_project_cohort(client):
643645
mock_check_billing_id.return_value = None
644646
mock_requests.side_effect = mocked_requests_get
645647

646-
data["outcome"]["cohort_ids"] = [4]
648+
data["outcome"]["cohort_ids"] = [400]
647649

648650
response = client.post(
649651
"/submit",

0 commit comments

Comments
 (0)