diff --git a/common/djangoapps/student/management/commands/anonymized_id_mapping.py b/common/djangoapps/student/management/commands/anonymized_id_mapping.py index c306867c55..11c518a6d8 100644 --- a/common/djangoapps/student/management/commands/anonymized_id_mapping.py +++ b/common/djangoapps/student/management/commands/anonymized_id_mapping.py @@ -8,15 +8,17 @@ the following: ./manage.py lms anonymized_id_mapping COURSE_ID """ +from __future__ import absolute_import + import csv from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError - -from student.models import anonymous_id_for_user from opaque_keys.edx.keys import CourseKey from six import text_type +from student.models import anonymous_id_for_user + class Command(BaseCommand): """Add our handler to the space where django-admin looks up commands.""" diff --git a/common/djangoapps/student/management/commands/bulk_change_enrollment.py b/common/djangoapps/student/management/commands/bulk_change_enrollment.py index e1f65034ba..7991cc6890 100644 --- a/common/djangoapps/student/management/commands/bulk_change_enrollment.py +++ b/common/djangoapps/student/management/commands/bulk_change_enrollment.py @@ -1,4 +1,6 @@ """Management command to change many user enrollments at once.""" +from __future__ import absolute_import + import logging from django.core.management.base import BaseCommand, CommandError diff --git a/common/djangoapps/student/management/commands/bulk_unenroll.py b/common/djangoapps/student/management/commands/bulk_unenroll.py index 16009318b4..2d73b9aeda 100644 --- a/common/djangoapps/student/management/commands/bulk_unenroll.py +++ b/common/djangoapps/student/management/commands/bulk_unenroll.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + import logging import unicodecsv @@ -9,7 +11,6 @@ from opaque_keys.edx.keys import CourseKey from student.models import CourseEnrollment, User - logger = logging.getLogger(__name__) # pylint: disable=invalid-name diff --git a/common/djangoapps/student/management/commands/cert_restriction.py b/common/djangoapps/student/management/commands/cert_restriction.py index f57ccf70d5..e6479b7e7a 100644 --- a/common/djangoapps/student/management/commands/cert_restriction.py +++ b/common/djangoapps/student/management/commands/cert_restriction.py @@ -1,4 +1,4 @@ -from __future__ import print_function +from __future__ import absolute_import, print_function import csv import os diff --git a/common/djangoapps/student/management/commands/change_eligibility_deadline.py b/common/djangoapps/student/management/commands/change_eligibility_deadline.py index 6b2f2bcdcf..59ec1b9847 100644 --- a/common/djangoapps/student/management/commands/change_eligibility_deadline.py +++ b/common/djangoapps/student/management/commands/change_eligibility_deadline.py @@ -1,15 +1,17 @@ """ Command line script to change credit course eligibility deadline. """ +from __future__ import absolute_import + import logging from datetime import datetime, timedelta -from course_modes.models import CourseMode from django.core.management.base import BaseCommand from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey -from student.models import CourseEnrollment, User +from course_modes.models import CourseMode from openedx.core.djangoapps.credit.models import CreditEligibility +from student.models import CourseEnrollment, User logger = logging.getLogger(__name__) # pylint: disable=invalid-name diff --git a/common/djangoapps/student/management/commands/create_random_users.py b/common/djangoapps/student/management/commands/create_random_users.py index 0213ae81e2..71904a45ea 100644 --- a/common/djangoapps/student/management/commands/create_random_users.py +++ b/common/djangoapps/student/management/commands/create_random_users.py @@ -1,14 +1,17 @@ """ A script to create some dummy users """ -from __future__ import print_function +from __future__ import absolute_import, print_function + import uuid from django.core.management.base import BaseCommand -from student.models import CourseEnrollment from opaque_keys.edx.keys import CourseKey +from six.moves import range + from student.forms import AccountCreationForm from student.helpers import do_create_account +from student.models import CourseEnrollment def make_random_form(): diff --git a/common/djangoapps/student/management/commands/delete_historical_enrollment_data.py b/common/djangoapps/student/management/commands/delete_historical_enrollment_data.py index 1131b47cc3..2393aa5d09 100644 --- a/common/djangoapps/student/management/commands/delete_historical_enrollment_data.py +++ b/common/djangoapps/student/management/commands/delete_historical_enrollment_data.py @@ -2,9 +2,13 @@ Command to delete all rows from the student_historicalcourseenrollment table. """ +from __future__ import absolute_import + import logging + +from openedx.core.djangoapps.util.row_delete import BaseDeletionCommand, delete_rows from student.models import CourseEnrollment -from openedx.core.djangoapps.util.row_delete import delete_rows, BaseDeletionCommand + log = logging.getLogger(__name__) diff --git a/common/djangoapps/student/management/commands/set_superuser.py b/common/djangoapps/student/management/commands/set_superuser.py index 1795d773f3..fd6845893d 100644 --- a/common/djangoapps/student/management/commands/set_superuser.py +++ b/common/djangoapps/student/management/commands/set_superuser.py @@ -1,5 +1,5 @@ """Management command to grant or revoke superuser access for one or more users""" -from __future__ import print_function +from __future__ import absolute_import, print_function from django.contrib.auth.models import User from django.core.management.base import BaseCommand diff --git a/common/djangoapps/student/management/commands/transfer_students.py b/common/djangoapps/student/management/commands/transfer_students.py index 84306e732e..d4472c221a 100644 --- a/common/djangoapps/student/management/commands/transfer_students.py +++ b/common/djangoapps/student/management/commands/transfer_students.py @@ -1,15 +1,15 @@ """ Transfer Student Management Command """ -from __future__ import print_function, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals from textwrap import dedent -from six import text_type - from django.contrib.auth.models import User from django.db import transaction from opaque_keys.edx.keys import CourseKey +from six import text_type + from shoppingcart.models import CertificateItem from student.models import CourseEnrollment from track.management.tracked_command import TrackedCommand