Skip to content

Commit

Permalink
Merge pull request #79 from cloudblue/bug/LITE-28334-Wrong-id-on-Mark…
Browse files Browse the repository at this point in the history
…etplaceConfiguration-when-we-save-data-with-all-flag

LITE-28334: Saving the right marketplace id, instead of the id of the…
  • Loading branch information
d3rky authored Aug 7, 2023
2 parents 2d63a6c + 47d94da commit 3c77cf7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion connect_ext_ppr/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def add_new_deployment_request(db, dr_data, deployment, account_id, logger):

marketplaces = [m.id for m in dr_data.marketplaces.choices]
if dr_data.marketplaces.all:
marketplaces = [m.id for m in deployment.marketplaces]
marketplaces = [m.marketplace for m in deployment.marketplaces]

for m_id in marketplaces:
mc = MarketplaceConfiguration(
Expand Down
5 changes: 4 additions & 1 deletion tests/api/test_deployment_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,10 @@ def test_create_deployment_request_with_all_marketplaces(

assert dbsession.query(MarketplaceConfiguration).filter_by(
deployment_request=deployment_request.id,
).filter(MarketplaceConfiguration.deployment_id.is_(null())).count() == 2
).filter(
MarketplaceConfiguration.deployment_id.is_(null()),
MarketplaceConfiguration.marketplace.in_(['MP-123', 'MP-124']),
).count() == 2


def test_create_deployment_request_invalid_deployment(
Expand Down

0 comments on commit 3c77cf7

Please sign in to comment.