Fix xxslint errors in touched files
This commit is contained in:
@@ -9,6 +9,8 @@ from django.core.cache import cache
|
||||
from django.db import models
|
||||
from opaque_keys.edx.django.models import CourseKeyField
|
||||
|
||||
from openedx.core.djangolib.markup import HTML
|
||||
|
||||
|
||||
class GlobalStatusMessage(ConfigurationModel):
|
||||
"""
|
||||
@@ -39,7 +41,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 = u"{} <br /> {}".format(msg, course_home_message.message)
|
||||
msg = HTML(u"{} <br /> {}").format(HTML(msg), HTML(course_home_message.message))
|
||||
except CourseMessage.DoesNotExist:
|
||||
# We don't have a course-specific message, so pass.
|
||||
pass
|
||||
|
||||
@@ -62,8 +62,8 @@ class BadgeClass(models.Model):
|
||||
image = models.ImageField(upload_to='badge_classes', validators=[validate_badge_image])
|
||||
|
||||
def __unicode__(self):
|
||||
return u"<Badge '{slug}' for '{issuing_component}'>".format(
|
||||
slug=self.slug, issuing_component=self.issuing_component
|
||||
return HTML(u"<Badge '{slug}' for '{issuing_component}'>").format(
|
||||
slug=HTML(self.slug), issuing_component=HTML(self.issuing_component)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -154,9 +154,10 @@ class BadgeAssertion(TimeStampedModel):
|
||||
assertion_url = models.URLField()
|
||||
|
||||
def __unicode__(self):
|
||||
return u"<{username} Badge Assertion for {slug} for {issuing_component}".format(
|
||||
username=self.user.username, slug=self.badge_class.slug,
|
||||
issuing_component=self.badge_class.issuing_component,
|
||||
return HTML(u"<{username} Badge Assertion for {slug} for {issuing_component}").format(
|
||||
username=HTML(self.user.username),
|
||||
slug=HTML(self.badge_class.slug),
|
||||
issuing_component=HTML(self.badge_class.issuing_component),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -204,9 +205,9 @@ class CourseCompleteImageConfiguration(models.Model):
|
||||
)
|
||||
|
||||
def __unicode__(self):
|
||||
return u"<CourseCompleteImageConfiguration for '{mode}'{default}>".format(
|
||||
mode=self.mode,
|
||||
default=u" (default)" if self.default else u''
|
||||
return HTML(u"<CourseCompleteImageConfiguration for '{mode}'{default}>").format(
|
||||
mode=HTML(self.mode),
|
||||
default=HTML(u" (default)") if self.default else HTML(u'')
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
|
||||
@@ -27,6 +27,8 @@ from six import text_type
|
||||
import coursewarehistoryextended
|
||||
from opaque_keys.edx.django.models import BlockTypeKeyField, CourseKeyField, UsageKeyField
|
||||
|
||||
from openedx.core.djangolib.markup import HTML
|
||||
|
||||
log = logging.getLogger("edx.courseware")
|
||||
|
||||
|
||||
@@ -290,7 +292,10 @@ class XBlockFieldBase(models.Model):
|
||||
|
||||
def __unicode__(self):
|
||||
keys = [field.name for field in self._meta.get_fields() if field.name not in ('created', 'modified')]
|
||||
return u'{}<{!r}'.format(self.__class__.__name__, {key: getattr(self, key) for key in keys})
|
||||
return HTML(u'{}<{!r}').format(
|
||||
HTML(self.__class__.__name__),
|
||||
{key: HTML(getattr(self, key)) for key in keys}
|
||||
)
|
||||
|
||||
|
||||
class XModuleUserStateSummaryField(XBlockFieldBase):
|
||||
|
||||
@@ -164,6 +164,7 @@ class SurveyForm(TimeStampedModel):
|
||||
|
||||
|
||||
class SurveyAnswer(TimeStampedModel):
|
||||
# pylint: disable=line-too-long
|
||||
"""
|
||||
Model for the answers that a user gives for a particular form in a course
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ from organizations.models import Organization
|
||||
from pytz import utc
|
||||
|
||||
from openedx.core.djangoapps.oauth_dispatch.toggles import ENFORCE_JWT_SCOPES
|
||||
from openedx.core.djangolib.markup import HTML
|
||||
from openedx.core.lib.request_utils import get_request_or_stub
|
||||
|
||||
|
||||
@@ -35,8 +36,8 @@ class RestrictedApplication(models.Model):
|
||||
"""
|
||||
Return a unicode representation of this object
|
||||
"""
|
||||
return u"<RestrictedApplication '{name}'>".format(
|
||||
name=self.application.name
|
||||
return HTML(u"<RestrictedApplication '{name}'>").format(
|
||||
name=HTML(self.application.name)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -759,7 +759,7 @@ def _get_xsscommitlint_count(filename):
|
||||
@task
|
||||
@needs('pavelib.prereqs.install_python_prereqs')
|
||||
@timed
|
||||
def run_pii_check(options):
|
||||
def run_pii_check(options): # pylint: disable=unused-argument
|
||||
"""
|
||||
Guarantee that all Django models are PII-annotated.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user