|
66 | 66 | import json |
67 | 67 | import logging |
68 | 68 |
|
| 69 | +import edx_api_doc_tools as apidocs |
69 | 70 | from django.conf import settings |
70 | 71 | from django.contrib.auth import authenticate, get_user_model, login |
71 | 72 | from django.contrib.auth.models import Group |
|
78 | 79 | from django.views.decorators.csrf import csrf_exempt |
79 | 80 | from django.views.generic.base import TemplateResponseMixin, View |
80 | 81 | from drf_yasg.utils import swagger_auto_schema |
81 | | -from openedx.core.djangoapps.content_libraries.api.libraries import get_backup_task_status |
82 | | -from pylti1p3.contrib.django import DjangoCacheDataStorage, DjangoDbToolConf, DjangoMessageLaunch, DjangoOIDCLogin |
83 | | -from pylti1p3.exception import LtiException, OIDCException |
84 | | - |
85 | | -import edx_api_doc_tools as apidocs |
86 | 82 | from opaque_keys.edx.locator import LibraryLocatorV2, LibraryUsageLocatorV2 |
87 | 83 | from organizations.api import ensure_organization |
88 | 84 | from organizations.exceptions import InvalidOrganizationException |
89 | 85 | from organizations.models import Organization |
| 86 | +from pylti1p3.contrib.django import DjangoCacheDataStorage, DjangoDbToolConf, DjangoMessageLaunch, DjangoOIDCLogin |
| 87 | +from pylti1p3.exception import LtiException, OIDCException |
90 | 88 | from rest_framework import status |
91 | 89 | from rest_framework.exceptions import NotFound, PermissionDenied, ValidationError |
92 | 90 | from rest_framework.generics import GenericAPIView |
93 | 91 | from rest_framework.response import Response |
94 | 92 | from rest_framework.views import APIView |
95 | 93 | from rest_framework.viewsets import GenericViewSet |
96 | 94 |
|
97 | | - |
| 95 | +import openedx.core.djangoapps.site_configuration.helpers as configuration_helpers |
98 | 96 | from cms.djangoapps.contentstore.views.course import ( |
99 | 97 | get_allowed_organizations_for_libraries, |
100 | | - user_can_create_organizations, |
| 98 | + user_can_create_organizations |
101 | 99 | ) |
102 | 100 | from openedx.core.djangoapps.content_libraries import api, permissions |
103 | | -from openedx.core.djangoapps.content_libraries.tasks import backup_library |
| 101 | +from openedx.core.djangoapps.content_libraries.api.libraries import get_backup_task_status |
104 | 102 | from openedx.core.djangoapps.content_libraries.rest_api.serializers import ( |
| 103 | + ContentLibraryAddPermissionByEmailSerializer, |
105 | 104 | ContentLibraryBlockImportTaskCreateSerializer, |
106 | 105 | ContentLibraryBlockImportTaskSerializer, |
107 | 106 | ContentLibraryFilterSerializer, |
|
114 | 113 | LibraryXBlockCreationSerializer, |
115 | 114 | LibraryXBlockMetadataSerializer, |
116 | 115 | LibraryXBlockTypeSerializer, |
117 | | - ContentLibraryAddPermissionByEmailSerializer, |
118 | | - PublishableItemSerializer, |
| 116 | + PublishableItemSerializer |
119 | 117 | ) |
120 | | -import openedx.core.djangoapps.site_configuration.helpers as configuration_helpers |
121 | | -from openedx.core.lib.api.view_utils import view_auth_classes |
| 118 | +from openedx.core.djangoapps.content_libraries.tasks import backup_library |
122 | 119 | from openedx.core.djangoapps.safe_sessions.middleware import mark_user_change_as_expected |
123 | 120 | from openedx.core.djangoapps.xblock import api as xblock_api |
| 121 | +from openedx.core.lib.api.view_utils import view_auth_classes |
124 | 122 |
|
125 | | -from .utils import convert_exceptions |
126 | 123 | from ..models import ContentLibrary, LtiGradedResource, LtiProfile |
127 | | - |
| 124 | +from .utils import convert_exceptions |
128 | 125 |
|
129 | 126 | User = get_user_model() |
130 | 127 | log = logging.getLogger(__name__) |
|
0 commit comments