From 198c47a20e1af6a101eb246ee8a5f1c2a01325a3 Mon Sep 17 00:00:00 2001 From: Arunmozhi Date: Wed, 25 Sep 2024 10:31:35 +1000 Subject: [PATCH] refactor: apply review suggestion on fix --- course_discovery/apps/course_metadata/data_loaders/api.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index e0cfef8cf4..a8a6045227 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -572,10 +572,7 @@ def update_seats(self, body): def update_seat(self, course_run, product_body): stock_record = product_body['stockrecords'][0] currency_code = stock_record['price_currency'] - if 'price_excl_tax' in stock_record: - price = Decimal(stock_record['price_excl_tax']) - else: - price = Decimal(stock_record['price']) + price = Decimal(stock_record.get('price_excl_tax', stock_record['price'])) sku = stock_record['partner_sku'] # For more context see ADR docs/decisions/0025-dont-sync-mobile-skus-on-discovery.rst