diff --git a/common/djangoapps/course_modes/migrations/0009_suggested_prices_to_charfield.py b/common/djangoapps/course_modes/migrations/0009_suggested_prices_to_charfield.py new file mode 100644 index 0000000000..60ed720cfd --- /dev/null +++ b/common/djangoapps/course_modes/migrations/0009_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', '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')]), + ), + ] diff --git a/common/djangoapps/course_modes/models.py b/common/djangoapps/course_modes/models.py index 8cdd9e9381..69a352ab62 100644 --- a/common/djangoapps/course_modes/models.py +++ b/common/djangoapps/course_modes/models.py @@ -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 diff --git a/common/static/common/templates/discussion/new-post.underscore b/common/static/common/templates/discussion/new-post.underscore index 0cf7fb928c..10fca6d593 100644 --- a/common/static/common/templates/discussion/new-post.underscore +++ b/common/static/common/templates/discussion/new-post.underscore @@ -48,21 +48,21 @@
<% } %> diff --git a/conf/locale/config.yaml b/conf/locale/config.yaml index 93bb7a4c22..5d9374a1e4 100644 --- a/conf/locale/config.yaml +++ b/conf/locale/config.yaml @@ -2,7 +2,7 @@ # This will copy each source language to a new directory at the end of the i18n generate step # which allows us to migrate to a new locale code without re-creating the Transifex project. -edx-lang-map: +edx_lang_map: zh_CN: zh_HANS locales: diff --git a/lms/djangoapps/discussion/tasks.py b/lms/djangoapps/discussion/tasks.py index 5c5fe4fcfa..ed360dc3e7 100644 --- a/lms/djangoapps/discussion/tasks.py +++ b/lms/djangoapps/discussion/tasks.py @@ -3,7 +3,6 @@ Defines asynchronous celery task for sending email notification (through edx-ace pertaining to new discussion forum comments. """ import logging -from urllib import urlencode from urlparse import urljoin from celery import task @@ -41,8 +40,9 @@ class ResponseNotification(MessageType): @task(base=LoggedTask, routing_key=ROUTING_KEY) def send_ace_message(context): context['course_id'] = CourseKey.from_string(context['course_id']) - context['site'] = Site.objects.get(id=context['site_id']) + if _should_send_message(context): + context['site'] = Site.objects.get(id=context['site_id']) thread_author = User.objects.get(id=context['thread_author_id']) middleware_classes = [ CurrentRequestUserMiddleware, diff --git a/lms/static/coffee/src/customwmd.coffee b/lms/static/coffee/src/customwmd.coffee index c0240b4617..f6339eabf4 100644 --- a/lms/static/coffee/src/customwmd.coffee +++ b/lms/static/coffee/src/customwmd.coffee @@ -133,7 +133,7 @@ if Markdown? .append($("