From 20fdd1046bdba83284f3d2cd0cfbf3d3e7706615 Mon Sep 17 00:00:00 2001 From: David Franco Date: Thu, 16 Mar 2023 09:38:37 +0100 Subject: [PATCH] CAD-760 implement the correction for the pricelist --- reports/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/reports/utils.py b/reports/utils.py index 9a12c9e..0e9fe91 100644 --- a/reports/utils.py +++ b/reports/utils.py @@ -242,7 +242,11 @@ def get_base_currency_financials(financials_and_seats: dict, currency: dict) -> def get_financials_from_product_per_marketplace(client, marketplace_id, asset_id): listing = api_calls.request_listing(client, marketplace_id, asset_id) price_list_points = [] - if listing and listing['pricelist']: - price_list_version = api_calls.request_price_list(client, listing['pricelist']['id']) - price_list_points = api_calls.request_price_list_version_points(client, price_list_version['id']) + + try: + if listing and listing['pricelist']: + price_list_version = api_calls.request_price_list(client, listing['pricelist']['id']) + price_list_points = api_calls.request_price_list_version_points(client, price_list_version['id']) + except: + return {} return get_financials_from_price_list(price_list_points)