diff --git a/common/djangoapps/status/migrations/0001_initial.py b/common/djangoapps/status/migrations/0001_initial.py index db71ab541e..bd7583ae5a 100644 --- a/common/djangoapps/status/migrations/0001_initial.py +++ b/common/djangoapps/status/migrations/0001_initial.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- - - import django.db.models.deletion from django.conf import settings from django.db import migrations, models diff --git a/common/djangoapps/status/migrations/0002_update_help_text.py b/common/djangoapps/status/migrations/0002_update_help_text.py index bc6425de55..c93694d1a2 100644 --- a/common/djangoapps/status/migrations/0002_update_help_text.py +++ b/common/djangoapps/status/migrations/0002_update_help_text.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- - - from django.db import migrations, models @@ -14,6 +11,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='globalstatusmessage', name='message', - field=models.TextField(help_text=u'
The contents of this field will be displayed as a warning banner on all views.
To override the banner message for a specific course, refer to the Course Message configuration. Course Messages will only work if the global status message is enabled, so if you only want to add a banner to specific courses without adding a global status message, you should add a global status message with empty message text.
Finally, disable the global status message by adding another empty message with "enabled" unchecked.
', null=True, blank=True), + field=models.TextField(help_text='The contents of this field will be displayed as a warning banner on all views.
To override the banner message for a specific course, refer to the Course Message configuration. Course Messages will only work if the global status message is enabled, so if you only want to add a banner to specific courses without adding a global status message, you should add a global status message with empty message text.
Finally, disable the global status message by adding another empty message with "enabled" unchecked.
', null=True, blank=True), ), ] diff --git a/common/djangoapps/status/models.py b/common/djangoapps/status/models.py index 5f4634c6f9..d10937ae46 100644 --- a/common/djangoapps/status/models.py +++ b/common/djangoapps/status/models.py @@ -3,7 +3,6 @@ Store status messages in the database. """ -import six from config_models.admin import ConfigurationModelAdmin from config_models.models import ConfigurationModel from django.contrib import admin @@ -25,17 +24,17 @@ class GlobalStatusMessage(ConfigurationModel): message = models.TextField( blank=True, null=True, - help_text=u'The contents of this field will be displayed as a warning banner on all views.
' - u'To override the banner message for a specific course, refer to the Course Message configuration. ' # lint-amnesty, pylint: disable=line-too-long - u'Course Messages will only work if the global status message is enabled, so if you only want to add ' - u'a banner to specific courses without adding a global status message, you should add a global status ' # lint-amnesty, pylint: disable=line-too-long - u'message with empty message text.
' - u'Finally, disable the global status message by adding another empty message with "enabled" ' - u'unchecked.
') + help_text='The contents of this field will be displayed as a warning banner on all views.
' + 'To override the banner message for a specific course, refer to the Course Message configuration. ' # lint-amnesty, pylint: disable=line-too-long + 'Course Messages will only work if the global status message is enabled, so if you only want to add ' + 'a banner to specific courses without adding a global status message, you should add a global status ' # lint-amnesty, pylint: disable=line-too-long + 'message with empty message text.
' + 'Finally, disable the global status message by adding another empty message with "enabled" ' + 'unchecked.
') def full_message(self, course_key): """ Returns the full status message, including any course-specific status messages. """ - cache_key = "status_message.{course_id}".format(course_id=six.text_type(course_key)) + cache_key = "status_message.{course_id}".format(course_id=str(course_key)) if cache.get(cache_key): return cache.get(cache_key) @@ -45,7 +44,7 @@ class GlobalStatusMessage(ConfigurationModel): course_home_message = self.coursemessage_set.get(course_key=course_key) # Don't override the message if course_home_message is blank. if course_home_message: - msg = HTML(u"{}