diff --git a/openedx/core/djangoapps/content/block_structure/transformers.py b/openedx/core/djangoapps/content/block_structure/transformers.py index a8ad687123..49445734fb 100644 --- a/openedx/core/djangoapps/content/block_structure/transformers.py +++ b/openedx/core/djangoapps/content/block_structure/transformers.py @@ -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 diff --git a/openedx/core/djangoapps/content/learning_sequences/api/outlines.py b/openedx/core/djangoapps/content/learning_sequences/api/outlines.py index b7df990a3e..be217e1db3 100644 --- a/openedx/core/djangoapps/content/learning_sequences/api/outlines.py +++ b/openedx/core/djangoapps/content/learning_sequences/api/outlines.py @@ -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, diff --git a/openedx/core/djangoapps/content/learning_sequences/api/processors/base.py b/openedx/core/djangoapps/content/learning_sequences/api/processors/base.py index 773e8b0ed4..7738861443 100644 --- a/openedx/core/djangoapps/content/learning_sequences/api/processors/base.py +++ b/openedx/core/djangoapps/content/learning_sequences/api/processors/base.py @@ -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__) diff --git a/openedx/core/djangoapps/content/learning_sequences/api/processors/milestones.py b/openedx/core/djangoapps/content/learning_sequences/api/processors/milestones.py index 03f8763faa..688ad81254 100644 --- a/openedx/core/djangoapps/content/learning_sequences/api/processors/milestones.py +++ b/openedx/core/djangoapps/content/learning_sequences/api/processors/milestones.py @@ -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 diff --git a/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py b/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py index 156202a68a..ec5eaeffea 100644 --- a/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py +++ b/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py @@ -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 diff --git a/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py b/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py index 5067d3d6a7..72dcc7c147 100644 --- a/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py +++ b/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py @@ -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, diff --git a/openedx/core/djangoapps/content/learning_sequences/data.py b/openedx/core/djangoapps/content/learning_sequences/data.py index fc56d955be..5e39b4fc71 100644 --- a/openedx/core/djangoapps/content/learning_sequences/data.py +++ b/openedx/core/djangoapps/content/learning_sequences/data.py @@ -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 diff --git a/openedx/core/djangoapps/content/learning_sequences/models.py b/openedx/core/djangoapps/content/learning_sequences/models.py index ecf0632e9e..e24271c596 100644 --- a/openedx/core/djangoapps/content/learning_sequences/models.py +++ b/openedx/core/djangoapps/content/learning_sequences/models.py @@ -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 diff --git a/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py b/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py index 1da7121a53..3cdc23cafd 100644 --- a/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py +++ b/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py @@ -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 diff --git a/openedx/core/djangoapps/content/learning_sequences/views.py b/openedx/core/djangoapps/content/learning_sequences/views.py index 53657bb812..12828c670c 100644 --- a/openedx/core/djangoapps/content/learning_sequences/views.py +++ b/openedx/core/djangoapps/content/learning_sequences/views.py @@ -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