Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
d2d76439
Unverified
Commit
d2d76439
authored
Nov 20, 2017
by
Brian Mesick
Committed by
GitHub
Nov 20, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16610 from edx/bmedx/django111_commaseparated_fields
Move suggested_prices to CharField for Django 1.11 compat
parents
781af9ce
f93696ca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
common/djangoapps/course_modes/migrations/0009_suggested_prices_to_charfield.py
+21
-0
common/djangoapps/course_modes/models.py
+3
-2
No files found.
common/djangoapps/course_modes/migrations/0009_suggested_prices_to_charfield.py
0 → 100644
View file @
d2d76439
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
re
import
django.core.validators
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'course_modes'
,
'0008_course_key_field_to_foreign_key'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'coursemode'
,
name
=
'suggested_prices'
,
field
=
models
.
CharField
(
default
=
b
''
,
max_length
=
255
,
blank
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
re
.
compile
(
'^[
\\
d,]+
\\
Z'
),
'Enter only digits separated by commas.'
,
'invalid'
)]),
),
]
common/djangoapps/course_modes/models.py
View file @
d2d76439
...
...
@@ -8,11 +8,11 @@ import pytz
from
config_models.models
import
ConfigurationModel
from
django.conf
import
settings
from
django.core.exceptions
import
ValidationError
from
django.core.validators
import
validate_comma_separated_integer_list
from
django.db
import
models
from
django.db.models
import
Q
from
django.dispatch
import
receiver
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.encoding
import
force_text
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
opaque_keys.edx.keys
import
CourseKey
...
...
@@ -103,7 +103,8 @@ class CourseMode(models.Model):
# DEPRECATED: the suggested prices for this mode
# We used to allow users to choose from a set of prices, but we now allow only
# a single price. This field has been deprecated by `min_price`
suggested_prices
=
models
.
CommaSeparatedIntegerField
(
max_length
=
255
,
blank
=
True
,
default
=
''
)
suggested_prices
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
default
=
''
,
validators
=
[
validate_comma_separated_integer_list
])
# optional description override
# WARNING: will not be localized
...
...
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