Merge pull request #21070 from edx/INCR-406

INCR-406 python3 compatibility
This commit is contained in:
Ayub
2019-07-23 12:30:14 +05:00
committed by GitHub
9 changed files with 27 additions and 13 deletions

View File

@@ -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."""

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
from __future__ import print_function
from __future__ import absolute_import, print_function
import csv
import os

View File

@@ -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

View File

@@ -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():

View File

@@ -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__)

View File

@@ -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

View File

@@ -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