Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ecommerce
Commits
4bfaa544
Commit
4bfaa544
authored
Apr 06, 2015
by
Renzo Lucioni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix course data migration
parent
6e3770d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
20 deletions
+2
-20
ecommerce/extensions/catalogue/migrations/0002_auto_20150223_1052.py
+1
-2
ecommerce/extensions/fulfillment/modules.py
+1
-18
No files found.
ecommerce/extensions/catalogue/migrations/0002_auto_20150223_1052.py
View file @
4bfaa544
...
...
@@ -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
()
...
...
ecommerce/extensions/fulfillment/modules.py
View file @
4bfaa544
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment