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
9dff7779
Commit
9dff7779
authored
Aug 03, 2015
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #242 from edx/clintonb/idvr-fix
Update publication endpoint
parents
b19a8714
7b73802f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
ecommerce/extensions/api/serializers.py
+1
-1
ecommerce/extensions/api/v2/tests/views/test_publication.py
+3
-4
No files found.
ecommerce/extensions/api/serializers.py
View file @
9dff7779
...
@@ -207,7 +207,7 @@ class AtomicPublicationSerializer(serializers.Serializer): # pylint: disable=ab
...
@@ -207,7 +207,7 @@ class AtomicPublicationSerializer(serializers.Serializer): # pylint: disable=ab
# Extract arguments required for Seat creation, deserializing as necessary.
# Extract arguments required for Seat creation, deserializing as necessary.
certificate_type
=
attrs
[
'certificate_type'
]
certificate_type
=
attrs
[
'certificate_type'
]
id_verification_required
=
(
attrs
[
'id_verification_required'
]
==
'True'
)
id_verification_required
=
attrs
[
'id_verification_required'
]
price
=
Decimal
(
product
[
'price'
])
price
=
Decimal
(
product
[
'price'
])
# Extract arguments which are optional for Seat creation, deserializing as necessary.
# Extract arguments which are optional for Seat creation, deserializing as necessary.
...
...
ecommerce/extensions/api/v2/tests/views/test_publication.py
View file @
9dff7779
...
@@ -44,7 +44,7 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
...
@@ -44,7 +44,7 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
},
},
{
{
'name'
:
'id_verification_required'
,
'name'
:
'id_verification_required'
,
'value'
:
'False'
'value'
:
False
}
}
]
]
},
},
...
@@ -59,7 +59,7 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
...
@@ -59,7 +59,7 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
},
},
{
{
'name'
:
'id_verification_required'
,
'name'
:
'id_verification_required'
,
'value'
:
'True'
'value'
:
True
}
}
]
]
}
}
...
@@ -89,7 +89,6 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
...
@@ -89,7 +89,6 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
attrs
=
{
attr
[
'name'
]:
attr
[
'value'
]
for
attr
in
product
[
'attribute_values'
]}
attrs
=
{
attr
[
'name'
]:
attr
[
'value'
]
for
attr
in
product
[
'attribute_values'
]}
attrs
[
'expires'
]
=
EXPIRES
if
product
[
'expires'
]
else
None
attrs
[
'expires'
]
=
EXPIRES
if
product
[
'expires'
]
else
None
attrs
[
'id_verification_required'
]
=
(
attrs
[
'id_verification_required'
]
==
'True'
)
attrs
[
'price'
]
=
Decimal
(
product
[
'price'
])
attrs
[
'price'
]
=
Decimal
(
product
[
'price'
])
course
.
create_or_update_seat
(
**
attrs
)
course
.
create_or_update_seat
(
**
attrs
)
...
@@ -135,7 +134,7 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
...
@@ -135,7 +134,7 @@ class AtomicPublicationTests(CourseCatalogTestMixin, UserMixin, TestCase):
if
name
==
'certificate_type'
:
if
name
==
'certificate_type'
:
certificate_type
=
attr
[
'value'
]
certificate_type
=
attr
[
'value'
]
elif
name
==
'id_verification_required'
:
elif
name
==
'id_verification_required'
:
id_verification_required
=
True
if
attr
[
'value'
]
==
'True'
else
False
id_verification_required
=
attr
[
'value'
]
seat_title
=
'Seat in {course_name} with {certificate_type} certificate'
.
format
(
seat_title
=
'Seat in {course_name} with {certificate_type} certificate'
.
format
(
course_name
=
course
.
name
,
course_name
=
course
.
name
,
...
...
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