Merge pull request #26580 from edx/jawayria/bom-2352-7
BOM-2352: Removed unused imports from lms/djangoapps/{instructor_anal…
This commit is contained in:
@@ -13,7 +13,7 @@ from django.conf import settings
|
||||
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db.models import Count, Q # lint-amnesty, pylint: disable=unused-import
|
||||
from django.db.models import Count # lint-amnesty, pylint: disable=unused-import
|
||||
from django.urls import reverse
|
||||
from edx_proctoring.api import get_exam_violation_report
|
||||
from opaque_keys.edx.keys import CourseKey, UsageKey
|
||||
|
||||
@@ -4,32 +4,20 @@ Tests for instructor.basic
|
||||
"""
|
||||
|
||||
|
||||
import datetime # lint-amnesty, pylint: disable=unused-import, wrong-import-order
|
||||
import json
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
import ddt
|
||||
import pytz # lint-amnesty, pylint: disable=unused-import
|
||||
from django.db.models import Q # lint-amnesty, pylint: disable=unused-import
|
||||
from django.urls import reverse # lint-amnesty, pylint: disable=unused-import
|
||||
import json # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from edx_proctoring.api import create_exam
|
||||
from edx_proctoring.models import ProctoredExamStudentAttempt
|
||||
from opaque_keys.edx.locator import UsageKey
|
||||
|
||||
from common.djangoapps.course_modes.models import CourseMode # lint-amnesty, pylint: disable=unused-import
|
||||
from common.djangoapps.course_modes.tests.factories import \
|
||||
CourseModeFactory # lint-amnesty, pylint: disable=unused-import
|
||||
from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed
|
||||
from common.djangoapps.student.roles import CourseSalesAdminRole # lint-amnesty, pylint: disable=unused-import
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
from six.moves import range, zip
|
||||
from lms.djangoapps.courseware.tests.factories import InstructorFactory
|
||||
from lms.djangoapps.instructor_analytics.basic import ( # lint-amnesty, pylint: disable=unused-import
|
||||
AVAILABLE_FEATURES,
|
||||
PROFILE_FEATURES,
|
||||
STUDENT_FEATURES,
|
||||
StudentModule,
|
||||
coupon_codes_features,
|
||||
course_registration_features,
|
||||
enrolled_students_features,
|
||||
get_proctored_exam_results,
|
||||
get_response_state,
|
||||
@@ -37,6 +25,8 @@ from lms.djangoapps.instructor_analytics.basic import ( # lint-amnesty, pylint:
|
||||
list_problem_responses
|
||||
)
|
||||
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
|
||||
from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import logging
|
||||
from functools import partial
|
||||
|
||||
from celery import shared_task
|
||||
from django.conf import settings # lint-amnesty, pylint: disable=unused-import
|
||||
from django.utils.translation import ugettext_noop
|
||||
from edx_django_utils.monitoring import set_code_owner_attribute
|
||||
|
||||
|
||||
@@ -6,24 +6,13 @@ Instructor tasks related to enrollments.
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from time import time
|
||||
|
||||
from django.conf import settings # lint-amnesty, pylint: disable=unused-import
|
||||
from django.utils.translation import ugettext as _ # lint-amnesty, pylint: disable=unused-import
|
||||
from pytz import UTC
|
||||
|
||||
from common.djangoapps.edxmako.shortcuts import render_to_string # lint-amnesty, pylint: disable=unused-import
|
||||
from common.djangoapps.student.models import ( # lint-amnesty, pylint: disable=unused-import
|
||||
CourseAccessRole,
|
||||
CourseEnrollment
|
||||
)
|
||||
from common.djangoapps.util.file import course_filename_prefix_generator # lint-amnesty, pylint: disable=unused-import
|
||||
from lms.djangoapps.courseware.courses import get_course_by_id # lint-amnesty, pylint: disable=unused-import
|
||||
from lms.djangoapps.instructor_analytics.basic import enrolled_students_features, list_may_enroll
|
||||
from lms.djangoapps.instructor_analytics.csvs import format_dictlist
|
||||
from lms.djangoapps.instructor_task.models import ReportStore # lint-amnesty, pylint: disable=unused-import
|
||||
from common.djangoapps.student.models import CourseEnrollment # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
from .runner import TaskProgress
|
||||
from .utils import tracker_emit, upload_csv_to_report_store # lint-amnesty, pylint: disable=unused-import
|
||||
from .utils import upload_csv_to_report_store # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
TASK_LOG = logging.getLogger('edx.celery.task')
|
||||
FILTERED_OUT_ROLES = ['staff', 'instructor', 'finance_admin', 'sales_admin']
|
||||
|
||||
@@ -7,14 +7,11 @@ running state of a course.
|
||||
|
||||
import csv
|
||||
import logging
|
||||
import os # lint-amnesty, pylint: disable=unused-import
|
||||
from collections import OrderedDict
|
||||
from contextlib import contextmanager
|
||||
from datetime import datetime
|
||||
from io import StringIO # lint-amnesty, pylint: disable=unused-import
|
||||
from tempfile import TemporaryFile
|
||||
from time import time
|
||||
from zipfile import ZipFile # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
|
||||
from django.core.exceptions import ValidationError
|
||||
@@ -29,7 +26,13 @@ from openedx.core.djangoapps.course_groups.cohorts import add_user_to_cohort
|
||||
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
|
||||
|
||||
from .runner import TaskProgress
|
||||
from .utils import UPDATE_STATUS_FAILED, UPDATE_STATUS_SUCCEEDED, upload_csv_to_report_store, upload_zip_to_report_store
|
||||
from .utils import (
|
||||
UPDATE_STATUS_FAILED,
|
||||
UPDATE_STATUS_SUCCEEDED,
|
||||
upload_csv_to_report_store,
|
||||
upload_zip_to_report_store,
|
||||
|
||||
)
|
||||
|
||||
# define different loggers for use within tasks and on client side
|
||||
TASK_LOG = logging.getLogger('edx.celery.task')
|
||||
|
||||
@@ -7,7 +7,6 @@ paths actually work.
|
||||
|
||||
|
||||
import json
|
||||
from functools import partial # lint-amnesty, pylint: disable=unused-import
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
from uuid import uuid4
|
||||
import pytest
|
||||
|
||||
Reference in New Issue
Block a user