Merge pull request #26599 from edx/jawayria/bom-2408-2
BOM-2408: Removed unused imports from openedx/core/djangoapps/content
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
"""
|
||||
Module for a collection of BlockStructureTransformers.
|
||||
"""
|
||||
|
||||
|
||||
import functools # lint-amnesty, pylint: disable=unused-import
|
||||
from logging import getLogger
|
||||
|
||||
from .exceptions import TransformerDataIncompatible, TransformerException
|
||||
|
||||
@@ -7,15 +7,13 @@ import logging
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
from typing import Optional, List # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
import attr # lint-amnesty, pylint: disable=unused-import
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db import transaction
|
||||
from edx_django_utils.cache import TieredCache, get_cache_key # lint-amnesty, pylint: disable=unused-import
|
||||
from edx_django_utils.monitoring import function_trace, set_custom_attribute
|
||||
from opaque_keys import OpaqueKey
|
||||
from opaque_keys.edx.locator import LibraryLocator
|
||||
from edx_django_utils.cache import TieredCache # lint-amnesty, pylint: disable=unused-import
|
||||
from opaque_keys.edx.keys import CourseKey # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
from ..data import (
|
||||
@@ -28,6 +26,7 @@ from ..data import (
|
||||
UserCourseOutlineData,
|
||||
UserCourseOutlineDetailsData,
|
||||
VisibilityData,
|
||||
|
||||
)
|
||||
from ..models import (
|
||||
ContentError,
|
||||
|
||||
@@ -6,7 +6,7 @@ import logging
|
||||
from datetime import datetime
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from opaque_keys.edx.keys import CourseKey, UsageKey # lint-amnesty, pylint: disable=unused-import
|
||||
from opaque_keys.edx.keys import CourseKey # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
User = get_user_model()
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import logging
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from opaque_keys.edx.keys import CourseKey # lint-amnesty, pylint: disable=unused-import
|
||||
from common.djangoapps.util import milestones_helpers
|
||||
|
||||
from .base import OutlineProcessor
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# lint-amnesty, pylint: disable=missing-module-docstring
|
||||
import logging
|
||||
from collections import defaultdict, OrderedDict # lint-amnesty, pylint: disable=unused-import
|
||||
from collections import defaultdict # lint-amnesty, pylint: disable=unused-import
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from edx_when.api import get_dates_for_course
|
||||
from opaque_keys.edx.keys import CourseKey, UsageKey # lint-amnesty, pylint: disable=unused-import
|
||||
from opaque_keys.edx.keys import CourseKey # lint-amnesty, pylint: disable=unused-import
|
||||
from common.djangoapps.student.auth import user_has_role
|
||||
from common.djangoapps.student.roles import CourseBetaTesterRole
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from edx_when.api import set_dates_for_course
|
||||
from mock import patch
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from opaque_keys.edx.locator import LibraryLocator
|
||||
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag
|
||||
from lms.djangoapps.courseware.tests.factories import BetaTesterFactory
|
||||
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
|
||||
@@ -30,6 +29,7 @@ from ...data import (
|
||||
CourseVisibility,
|
||||
ExamData,
|
||||
VisibilityData,
|
||||
|
||||
)
|
||||
from ..outlines import (
|
||||
get_content_errors,
|
||||
|
||||
@@ -24,7 +24,7 @@ Note: we're using old-style syntax for attrs because we need to support Python
|
||||
TODO: Validate all datetimes to be UTC.
|
||||
"""
|
||||
import logging
|
||||
from datetime import datetime, timezone # lint-amnesty, pylint: disable=unused-import
|
||||
from datetime import datetime # lint-amnesty, pylint: disable=unused-import
|
||||
from enum import Enum
|
||||
from typing import Dict, List, Optional, Set
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ from django.db import models
|
||||
from model_utils.models import TimeStampedModel
|
||||
|
||||
from opaque_keys.edx.django.models import ( # lint-amnesty, pylint: disable=unused-import
|
||||
CourseKeyField, LearningContextKeyField, UsageKeyField
|
||||
LearningContextKeyField, UsageKeyField
|
||||
)
|
||||
from .data import CourseVisibility
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@ Where possible, seed data using public API methods (e.g. replace_course_outline
|
||||
from this app, edx-when's set_dates_for_course).
|
||||
"""
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user, unused-import
|
||||
from opaque_keys.edx.keys import CourseKey, UsageKey # lint-amnesty, pylint: disable=unused-import
|
||||
from opaque_keys.edx.keys import CourseKey # lint-amnesty, pylint: disable=unused-import
|
||||
from rest_framework.test import APITestCase, APIClient
|
||||
|
||||
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
|
||||
|
||||
@@ -3,7 +3,6 @@ The views.py for this app is intentionally thin, and only exists to translate
|
||||
user input/output to and from the business logic in the `api` package.
|
||||
"""
|
||||
from datetime import datetime, timezone
|
||||
import json # lint-amnesty, pylint: disable=unused-import
|
||||
import logging
|
||||
|
||||
from django.conf import settings
|
||||
@@ -16,7 +15,6 @@ from rest_framework import serializers
|
||||
from rest_framework.exceptions import NotFound
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
import attr # lint-amnesty, pylint: disable=unused-import
|
||||
|
||||
from openedx.core.lib.api.permissions import IsStaff
|
||||
from .api import get_user_course_outline_details
|
||||
|
||||
Reference in New Issue
Block a user