INCR-132: Run python-modernize on common/djangoapps/status (#20450)
* INCR-132: Run python-modernize on common/djangoapps/status * isort * isort migrations
This commit is contained in:
committed by
Michael Youngstrom
parent
65f4a63ecf
commit
489c78dfa7
@@ -1,10 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
from opaque_keys.edx.django.models import CourseKeyField
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
Store status messages in the database.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import six
|
||||
from config_models.admin import ConfigurationModelAdmin
|
||||
from config_models.models import ConfigurationModel
|
||||
from django.contrib import admin
|
||||
@@ -31,7 +34,7 @@ class GlobalStatusMessage(ConfigurationModel):
|
||||
|
||||
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=unicode(course_key))
|
||||
cache_key = "status_message.{course_id}".format(course_id=six.text_type(course_key))
|
||||
if cache.get(cache_key):
|
||||
return cache.get(cache_key)
|
||||
|
||||
@@ -66,7 +69,7 @@ class CourseMessage(models.Model):
|
||||
message = models.TextField(blank=True, null=True)
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.course_key)
|
||||
return six.text_type(self.course_key)
|
||||
|
||||
|
||||
admin.site.register(GlobalStatusMessage, ConfigurationModelAdmin)
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
A tiny app that checks for a status message.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
|
||||
from .models import GlobalStatusMessage
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
""" Tests for setting and displaying the site status message. """
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
import ddt
|
||||
|
||||
Reference in New Issue
Block a user