Skip to content

Commit

Permalink
Filter unadvised countries by static team id
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincarrogan committed Apr 25, 2024
1 parent 602ab41 commit 90017eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion caseworker/advice/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def unadvised_countries(caseworker, case):
dest_types = constants.DESTINATION_TYPES
advised_on = {
# Map of destinations advised on -> team that gave the advice
advice.get(dest_type): advice["user"]["team"]["id"]
advice.get(dest_type): advice["team"]["id"]
for dest_type in dest_types
for advice in case.advice
if advice.get(dest_type) is not None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ def test_fco_give_approval_advice_existing_get(mock_get_gov_user, authorized_cli
{
"end_user": "95d3ea36-6ab9-41ea-a744-7284d17b9cc5",
"user": {"team": {"id": "809eba0f-f197-4f0f-949b-9af309a844fb", "name": "MOD-DSTL"}},
"team": {"id": "809eba0f-f197-4f0f-949b-9af309a844fb", "name": "MOD-DSTL"},
},
# The AE-AZ destination has been advised on by FCO (should therefore not be rendered)
{
"consignee": "cd2263b4-a427-4f14-8552-505e1d192bb8",
"user": {
"team": {"id": "67b9a4a3-6f3d-4511-8a19-23ccff221a74", "name": "FCO", "alias": services.FCDO_TEAM}
"team": {"id": "67b9a4a3-6f3d-4511-8a19-23ccff221a74", "name": "FCO", "alias": services.FCDO_TEAM},
},
"team": {"id": "67b9a4a3-6f3d-4511-8a19-23ccff221a74", "name": "FCO", "alias": services.FCDO_TEAM},
},
]
response = authorized_client.get(url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ def test_fco_give_refusal_advice_existing_get(mock_get_gov_user, authorized_clie
{
"end_user": "95d3ea36-6ab9-41ea-a744-7284d17b9cc5",
"user": {"team": {"id": "809eba0f-f197-4f0f-949b-9af309a844fb", "name": "MOD-DSTL", "alias": "MOD_DSTL"}},
"team": {"id": "809eba0f-f197-4f0f-949b-9af309a844fb", "name": "MOD-DSTL", "alias": "MOD_DSTL"},
},
# The AE-AZ destination has been advised on by FCO (should therefore not be rendered)
{
"consignee": "cd2263b4-a427-4f14-8552-505e1d192bb8",
"user": {
"team": {"id": "67b9a4a3-6f3d-4511-8a19-23ccff221a74", "name": "FCO", "alias": services.FCDO_TEAM}
},
"team": {"id": "67b9a4a3-6f3d-4511-8a19-23ccff221a74", "name": "FCO", "alias": services.FCDO_TEAM},
},
]
response = authorized_client.get(url)
Expand Down

0 comments on commit 90017eb

Please sign in to comment.