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
f75493ca
Commit
f75493ca
authored
Feb 03, 2017
by
Ivan Ivic
Committed by
Ivan Ivic
Feb 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Validation for Course Seat Types in admin console
SOL-2202
parent
f3d06132
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
ecommerce/extensions/offer/models.py
+4
-4
No files found.
ecommerce/extensions/offer/models.py
View file @
f75493ca
...
...
@@ -154,7 +154,7 @@ class ConditionalOffer(AbstractConditionalOffer):
return
super
(
ConditionalOffer
,
self
)
.
is_condition_satisfied
(
basket
)
# pylint: disable=bad-super-call
def
validate_credit_seat_type
(
course_seat_types
,
allowed_seat_types
):
def
validate_credit_seat_type
(
course_seat_types
):
if
not
isinstance
(
course_seat_types
,
basestring
):
log_message_and_raise_validation_error
(
'Failed to create Range. Credit seat types must be of type string.'
)
...
...
@@ -165,10 +165,10 @@ def validate_credit_seat_type(course_seat_types, allowed_seat_types):
'Failed to create Range. Credit seat type cannot be paired with other seat types.'
)
if
not
set
(
course_seat_types_list
)
.
issubset
(
set
(
allowed_seat_types
)):
if
not
set
(
course_seat_types_list
)
.
issubset
(
set
(
Range
.
ALLOWED_SEAT_TYPES
)):
log_message_and_raise_validation_error
(
'Failed to create Range. Not allowed course seat types {}. '
'Allowed values for course seat types are {}.'
.
format
(
course_seat_types_list
,
allowed_seat_types
)
'Allowed values for course seat types are {}.'
.
format
(
course_seat_types_list
,
Range
.
ALLOWED_SEAT_TYPES
)
)
...
...
@@ -212,7 +212,7 @@ class Range(AbstractRange):
log_message_and_raise_validation_error
(
error_message
)
if
self
.
course_seat_types
:
validate_credit_seat_type
(
self
.
course_seat_types
,
self
.
ALLOWED_SEAT_TYPES
)
validate_credit_seat_type
(
self
.
course_seat_types
)
def
run_catalog_query
(
self
,
product
):
"""
...
...
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