Commit 4bfaa544 by Renzo Lucioni

Fix course data migration

parent 6e3770d0
......@@ -71,8 +71,7 @@ def create_catalog(apps, schema_editor):
upc="000000000002",
is_discountable=True,
slug="edx-demox-course-seat-honor",
structure='child',
product_class=seat
structure='child'
)
honor_seat.save()
......
......@@ -78,23 +78,6 @@ class FulfillmentModule(object):
"""
raise NotImplementedError("Revoke method not implemented!")
@staticmethod
def get_product_type(product):
"""Check for the product type.
Oscar Products all have a type, and Fulfillment Modules will often be directly associated with them. This
function will pull the type from the product, or the parent product. By design, Oscar Child Products do not have
a product type, but inherit from their parents.
Args:
product (Product): A product this module may fulfill.
Returns:
ProductClass representing the type of this product or its parent.
"""
return product.product_class if product.product_class is not None else product.parent.product_class
class EnrollmentFulfillmentModule(FulfillmentModule):
""" Fulfillment Module for enrolling students after a product purchase.
......@@ -121,7 +104,7 @@ class EnrollmentFulfillmentModule(FulfillmentModule):
"""
supported_lines = []
for line in lines:
if self.get_product_type(line.product).name == 'Seat':
if line.product.get_product_class().name == 'Seat':
supported_lines.append(line)
return supported_lines
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment