incr-277 (#20582)
* run python modernize * run isort * remove escape import
This commit is contained in:
committed by
Michael Youngstrom
parent
c2dcbb36b7
commit
c7f6ff14da
@@ -3,6 +3,8 @@ Provides a function for importing a git repository into the lms
|
||||
instance when using a mongo modulestore
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
@@ -15,10 +17,10 @@ from django.core import management
|
||||
from django.core.management.base import CommandError
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from xmodule.util.sandboxing import DEFAULT_PYTHON_LIB_FILENAME
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
|
||||
from dashboard.models import CourseImportLog
|
||||
from xmodule.util.sandboxing import DEFAULT_PYTHON_LIB_FILENAME
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Script for importing courseware from git/xml into a mongo modulestore
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Provide tests for git_add_course management command.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""Models for dashboard application"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import mongoengine
|
||||
|
||||
from xmodule.modulestore.mongoengine_fields import CourseKeyField
|
||||
|
||||
@@ -3,7 +3,7 @@ This module creates a sysadmin dashboard for managing and viewing
|
||||
courses.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
import unicodecsv as csv
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -11,6 +11,7 @@ import StringIO
|
||||
import subprocess
|
||||
|
||||
import mongoengine
|
||||
import unicodecsv as csv
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.models import User
|
||||
@@ -406,7 +407,7 @@ class Courses(SysadminDashboardView):
|
||||
_('Deleted'), text_type(course.location), text_type(course.id), course.display_name)
|
||||
|
||||
context = {
|
||||
'datatable': self.make_datatable(courses.values()),
|
||||
'datatable': self.make_datatable(list(courses.values())),
|
||||
'msg': self.msg,
|
||||
'djangopid': os.getpid(),
|
||||
'modeflag': {'courses': 'active-section'},
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Urls for sysadmin dashboard feature
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from dashboard import sysadmin
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Provide tests for sysadmin dashboard feature in sysadmin.py
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
@@ -11,13 +13,13 @@ from uuid import uuid4
|
||||
|
||||
import mongoengine
|
||||
from django.conf import settings
|
||||
from django.urls import reverse
|
||||
from django.utils.html import escape
|
||||
from django.test.client import Client
|
||||
from django.test.utils import override_settings
|
||||
from pytz import UTC
|
||||
from django.urls import reverse
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
from pytz import UTC
|
||||
from six import text_type
|
||||
from six.moves import range
|
||||
|
||||
from dashboard.git_import import GitImportErrorNoDir
|
||||
from dashboard.models import CourseImportLog
|
||||
@@ -26,10 +28,7 @@ from student.roles import CourseStaffRole, GlobalStaff
|
||||
from student.tests.factories import UserFactory
|
||||
from util.date_utils import DEFAULT_DATE_TIME_FORMAT, get_time_display
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
TEST_DATA_SPLIT_MODULESTORE,
|
||||
SharedModuleStoreTestCase
|
||||
)
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.mongo_connection import MONGO_HOST, MONGO_PORT_NUM
|
||||
|
||||
TEST_MONGODB_LOG = {
|
||||
@@ -303,7 +302,7 @@ class TestSysAdminMongoCourseImport(SysadminBaseTestCase):
|
||||
|
||||
mongoengine.connect(TEST_MONGODB_LOG['db'])
|
||||
|
||||
for _ in xrange(15):
|
||||
for _ in range(15):
|
||||
CourseImportLog(
|
||||
course_id=CourseLocator.from_string("test/test/test"),
|
||||
location="location",
|
||||
|
||||
Reference in New Issue
Block a user