From c8d90740a789c14a4597d4a577e41c53aa41d60b Mon Sep 17 00:00:00 2001 From: zubair-ce07 Date: Tue, 14 Nov 2023 14:58:32 +0500 Subject: [PATCH] fix: changes in code to pass checks --- ecommerce/entitlements/utils.py | 3 ++- ecommerce/extensions/catalogue/models.py | 4 ---- .../iap/management/commands/batch_update_mobile_seats.py | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ecommerce/entitlements/utils.py b/ecommerce/entitlements/utils.py index 10e7c760f99..9dd40ea4bec 100644 --- a/ecommerce/entitlements/utils.py +++ b/ecommerce/entitlements/utils.py @@ -74,11 +74,12 @@ def create_or_update_course_entitlement( course_entitlement.structure = Product.CHILD course_entitlement.is_discountable = True course_entitlement.title = 'Course {}'.format(title) + course_entitlement.parent = parent_entitlement course_entitlement.attr.certificate_type = certificate_type course_entitlement.attr.UUID = UUID course_entitlement.attr.id_verification_required = id_verification_required course_entitlement.attr.credit_provider = credit_provider - course_entitlement.parent = parent_entitlement + if variant_id: course_entitlement.attr.variant_id = variant_id if has_existing_course_entitlement: diff --git a/ecommerce/extensions/catalogue/models.py b/ecommerce/extensions/catalogue/models.py index 7d04e4a728d..3dd344d0e81 100644 --- a/ecommerce/extensions/catalogue/models.py +++ b/ecommerce/extensions/catalogue/models.py @@ -63,10 +63,6 @@ def post_delete(self, instance, using=None, **kwargs): class Product(AbstractProduct): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.attr = ProductAttributesContainer(product=self) - course = models.ForeignKey( 'courses.Course', null=True, blank=True, related_name='products', on_delete=models.CASCADE ) diff --git a/ecommerce/extensions/iap/management/commands/batch_update_mobile_seats.py b/ecommerce/extensions/iap/management/commands/batch_update_mobile_seats.py index d228905ba67..a19b34aa869 100644 --- a/ecommerce/extensions/iap/management/commands/batch_update_mobile_seats.py +++ b/ecommerce/extensions/iap/management/commands/batch_update_mobile_seats.py @@ -165,7 +165,6 @@ def _create_mobile_seat(self, sku_prefix, existing_web_seat): mobile_stock_record.partner_sku = partner_sku mobile_stock_record.price_currency = existing_stock_record.price_currency mobile_stock_record.price = existing_stock_record.price - mobile_stock_record.price_retail = existing_stock_record.price_retail mobile_stock_record.cost_price = existing_stock_record.cost_price mobile_stock_record.save()