Skip to content
Snippets Groups Projects
Unverified Commit 2b943d93 authored by Jawayria's avatar Jawayria Committed by GitHub
Browse files

Merge pull request #26537 from edx/jawayria/bom-2352-2

BOM-2352: Removed unused imports from lms/djangoapps/{certificates, c…
parents bf9e498b b3b0b083
No related merge requests found
......@@ -20,9 +20,9 @@ def revert_alter_unique(apps, schema_editor):
for org_id, course_key, mode in all_unique_templates_ignoring_language:
key = CourseKey.from_string(course_key) if course_key else CourseKeyField.Empty
templates = CertificateTemplateModel.objects.filter(organization_id=org_id, course_key=key, mode=mode)
if templates.count() > 1:
if templates.count() > 1:
# remove all templates past the first (null or default languages are ordered first)
language_specific_templates = templates.order_by('language')[1:]
language_specific_templates = templates.order_by('language')[1:]
language_specific_template_ids = language_specific_templates.values_list('id', flat=True)
for template in language_specific_templates:
log.info('Deleting template ' + str(template.id) + ' with details {' +
......
......@@ -22,7 +22,6 @@ from opaque_keys.edx.keys import CourseKey
from common.djangoapps.student.models import CourseEnrollment, User
from common.djangoapps.util.json_request import JsonResponse
from lms.djangoapps.certificates.api import get_certificates_for_user, regenerate_user_certificates
from lms.djangoapps.certificates.models import CertificateInvalidation
from lms.djangoapps.certificates.permissions import GENERATE_ALL_CERTIFICATES, VIEW_ALL_CERTIFICATES
from lms.djangoapps.instructor_task.api import generate_certificates_for_students
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
......
......@@ -18,7 +18,6 @@ from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client, is_commerce_service_configured
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.theming import helpers as theming_helpers
from common.djangoapps.student.models import CourseEnrollment # lint-amnesty, pylint: disable=unused-import
from .models import CommerceConfiguration
......
......@@ -9,7 +9,6 @@ from lms.djangoapps.courseware.access_response import AccessResponse
from lms.djangoapps.courseware.access_utils import ACCESS_DENIED, ACCESS_GRANTED, check_public_access
from lms.djangoapps.courseware.exceptions import CourseRunNotFound
from lms.djangoapps.courseware.courses import get_course
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview # lint-amnesty, pylint: disable=unused-import
from common.djangoapps.student.models import CourseEnrollment
from common.djangoapps.student.roles import CourseStaffRole
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC
......
......@@ -4,14 +4,11 @@ Course API Serializers. Representing course catalog data
from edx_django_utils import monitoring as monitoring_utils
import six.moves.urllib.error # lint-amnesty, pylint: disable=wrong-import-order
import six.moves.urllib.parse # lint-amnesty, pylint: disable=wrong-import-order
import six.moves.urllib.request # lint-amnesty, pylint: disable=wrong-import-order
from django.urls import reverse
from rest_framework import serializers
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview # lint-amnesty, pylint: disable=unused-import
from openedx.core.lib.api.fields import AbsoluteURLField
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment