From caebb910f0e6eb8f2938f075d71ff03f9e40f659 Mon Sep 17 00:00:00 2001 From: Jawayria Date: Fri, 12 Feb 2021 13:28:07 +0500 Subject: [PATCH] BOM-2351: Removed unused imports from common/djangoapps/student --- common/djangoapps/student/forms.py | 10 ---------- .../student/management/commands/bulk_unenroll.py | 1 - common/djangoapps/student/tests/test_admin_views.py | 1 - common/djangoapps/student/tests/test_course_listing.py | 2 +- .../djangoapps/student/tests/test_password_policy.py | 5 ----- .../student/tests/test_recent_enrollments.py | 2 -- common/djangoapps/student/tests/test_views.py | 2 +- common/djangoapps/student/views/management.py | 2 +- 8 files changed, 3 insertions(+), 22 deletions(-) diff --git a/common/djangoapps/student/forms.py b/common/djangoapps/student/forms.py index b8bbd2e5e4..15f17dbc35 100644 --- a/common/djangoapps/student/forms.py +++ b/common/djangoapps/student/forms.py @@ -2,17 +2,10 @@ Utility functions for validating forms """ - -import re # lint-amnesty, pylint: disable=unused-import -from importlib import import_module # lint-amnesty, pylint: disable=unused-import - from django.conf import settings -from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user, unused-import from django.contrib.auth.tokens import default_token_generator -from django.core.exceptions import ValidationError # lint-amnesty, pylint: disable=unused-import from django.urls import reverse from django.utils.http import int_to_base36 -from django.utils.translation import ugettext_lazy as _ # lint-amnesty, pylint: disable=unused-import from edx_ace import ace from edx_ace.recipient import Recipient @@ -20,12 +13,9 @@ from openedx.core.djangoapps.ace_common.template_context import get_base_templat from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.theming.helpers import get_current_site -from openedx.core.djangoapps.user_api import accounts as accounts_settings # lint-amnesty, pylint: disable=unused-import -from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled # lint-amnesty, pylint: disable=unused-import from openedx.core.djangoapps.user_authn.toggles import should_redirect_to_authn_microfrontend from openedx.core.djangoapps.user_api.preferences.api import get_user_preference from common.djangoapps.student.message_types import AccountRecovery as AccountRecoveryMessage -from common.djangoapps.student.models import CourseEnrollmentAllowed, email_exists_or_retired # lint-amnesty, pylint: disable=unused-import def send_account_recovery_email_for_user(user, request, email=None): diff --git a/common/djangoapps/student/management/commands/bulk_unenroll.py b/common/djangoapps/student/management/commands/bulk_unenroll.py index 19bbf271b8..451ccefbe0 100644 --- a/common/djangoapps/student/management/commands/bulk_unenroll.py +++ b/common/djangoapps/student/management/commands/bulk_unenroll.py @@ -4,7 +4,6 @@ Un-enroll Bulk users course wide as well as specified in csv import logging import unicodecsv -from django.core.exceptions import ObjectDoesNotExist # lint-amnesty, pylint: disable=unused-import from django.core.management.base import BaseCommand from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey diff --git a/common/djangoapps/student/tests/test_admin_views.py b/common/djangoapps/student/tests/test_admin_views.py index 7e986e32e3..c03cdf840e 100644 --- a/common/djangoapps/student/tests/test_admin_views.py +++ b/common/djangoapps/student/tests/test_admin_views.py @@ -9,7 +9,6 @@ import datetime import ddt import pytest import six -from django.conf import settings # lint-amnesty, pylint: disable=unused-import from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.forms import ValidationError diff --git a/common/djangoapps/student/tests/test_course_listing.py b/common/djangoapps/student/tests/test_course_listing.py index 7314be6678..ceaf25f30c 100644 --- a/common/djangoapps/student/tests/test_course_listing.py +++ b/common/djangoapps/student/tests/test_course_listing.py @@ -13,7 +13,7 @@ from django.test.client import Client from milestones.tests.utils import MilestonesTestCaseMixin from openedx.core.djangoapps.content.course_overviews.models import CourseOverview -from common.djangoapps.student.models import CourseEnrollment, DashboardConfiguration # lint-amnesty, pylint: disable=unused-import +from common.djangoapps.student.models import CourseEnrollment # lint-amnesty, pylint: disable=unused-import from common.djangoapps.student.roles import GlobalStaff from common.djangoapps.student.tests.factories import UserFactory from common.djangoapps.student.views import get_course_enrollments diff --git a/common/djangoapps/student/tests/test_password_policy.py b/common/djangoapps/student/tests/test_password_policy.py index 62980aa7b3..11bbf38b5a 100644 --- a/common/djangoapps/student/tests/test_password_policy.py +++ b/common/djangoapps/student/tests/test_password_policy.py @@ -5,15 +5,10 @@ This test file will verify proper password policy enforcement, which is an optio import json - -from django.contrib.auth.models import AnonymousUser # lint-amnesty, pylint: disable=unused-import from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings from django.urls import reverse -from mock import patch # lint-amnesty, pylint: disable=unused-import - -from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory # lint-amnesty, pylint: disable=unused-import from common.djangoapps.util.password_policy_validators import create_validator_config diff --git a/common/djangoapps/student/tests/test_recent_enrollments.py b/common/djangoapps/student/tests/test_recent_enrollments.py index bfc0016631..bc0d71ac0d 100644 --- a/common/djangoapps/student/tests/test_recent_enrollments.py +++ b/common/djangoapps/student/tests/test_recent_enrollments.py @@ -15,8 +15,6 @@ from pytz import UTC from six.moves import range, zip from common.test.utils import XssTestMixin -from common.djangoapps.course_modes.tests.factories import CourseModeFactory # lint-amnesty, pylint: disable=unused-import -from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration_context # lint-amnesty, pylint: disable=unused-import from common.djangoapps.student.models import CourseEnrollment, DashboardConfiguration from common.djangoapps.student.tests.factories import UserFactory from common.djangoapps.student.views import get_course_enrollments diff --git a/common/djangoapps/student/tests/test_views.py b/common/djangoapps/student/tests/test_views.py index 7f26e201fc..1c1a443316 100644 --- a/common/djangoapps/student/tests/test_views.py +++ b/common/djangoapps/student/tests/test_views.py @@ -7,7 +7,7 @@ import itertools import json import re import unittest -from datetime import datetime, timedelta # lint-amnesty, pylint: disable=unused-import +from datetime import timedelta # lint-amnesty, pylint: disable=unused-import import ddt import six diff --git a/common/djangoapps/student/views/management.py b/common/djangoapps/student/views/management.py index 0a62a604de..bd470d444e 100644 --- a/common/djangoapps/student/views/management.py +++ b/common/djangoapps/student/views/management.py @@ -58,7 +58,7 @@ from common.djangoapps.student.message_types import AccountActivation, EmailChan from common.djangoapps.student.models import ( # lint-amnesty, pylint: disable=unused-import AccountRecovery, CourseEnrollment, - PendingEmailChange, + PendingEmailChange, # unimport:skip PendingSecondaryEmailChange, Registration, RegistrationCookieConfiguration,