diff --git a/common/djangoapps/course_modes/migrations/0010_archived_suggested_prices_to_charfield.py b/common/djangoapps/course_modes/migrations/0010_archived_suggested_prices_to_charfield.py new file mode 100644 index 0000000000000000000000000000000000000000..b307d06472015ae13a2e3502bb8b0b0e55906ede --- /dev/null +++ b/common/djangoapps/course_modes/migrations/0010_archived_suggested_prices_to_charfield.py @@ -0,0 +1,21 @@ +# -*- 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', '0009_suggested_prices_to_charfield'), + ] + + operations = [ + migrations.AlterField( + model_name='coursemodesarchive', + 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')]), + ), + ] diff --git a/common/djangoapps/course_modes/models.py b/common/djangoapps/course_modes/models.py index 1f74070e057526fb8d8db786bde41365fc1ac944..3105f1c0509194e6ec36886e593b184774b8e7ec 100644 --- a/common/djangoapps/course_modes/models.py +++ b/common/djangoapps/course_modes/models.py @@ -810,7 +810,8 @@ class CourseModesArchive(models.Model): min_price = models.IntegerField(default=0) # the suggested prices for this mode - 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]) # the currency these prices are in, using lower case ISO currency codes currency = models.CharField(default="usd", max_length=8)