Skip to content

Commit 78604a5

Browse files
committed
Remove party key from read product
1 parent 7080fa6 commit 78604a5

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/layers/domain/api/common_steps/read_cpm_product.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent
44
from domain.core.cpm_product import CpmProduct
5-
from domain.core.error import NotCpmProductError
6-
from domain.core.product_key import ProductKeyType
75
from domain.core.product_team import ProductTeam
86
from domain.repository.cpm_product_repository import CpmProductRepository
97
from domain.repository.product_team_repository import ProductTeamRepository
@@ -39,22 +37,6 @@ def read_product(data, cache) -> CpmProduct:
3937
return cpm_product
4038

4139

42-
def get_party_key(data, cache) -> str:
43-
product: CpmProduct = data[read_product]
44-
party_keys = (
45-
key.key_value
46-
for key in product.keys
47-
if key.key_type is ProductKeyType.PARTY_KEY
48-
)
49-
try:
50-
(party_key,) = party_keys
51-
except ValueError:
52-
raise NotCpmProductError(
53-
"Not an EPR Product: Cannot create MHS Device for product without exactly one Party Key"
54-
)
55-
return party_key
56-
57-
5840
def product_to_dict(data, cache) -> tuple[str, dict]:
5941
product: CpmProduct = data[read_product]
6042
return HTTPStatus.OK, product.state()
@@ -65,7 +47,6 @@ def product_to_dict(data, cache) -> tuple[str, dict]:
6547
read_product_team,
6648
read_product,
6749
]
68-
epr_product_specific_steps = [get_party_key]
6950
after_steps = [
7051
product_to_dict,
7152
]

0 commit comments

Comments
 (0)