Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
e0ef561c
Commit
e0ef561c
authored
Dec 06, 2017
by
Tyler Hallada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run isort on cms/
Make sure safe_lxml is imported first for security
parent
90d7e96b
Hide whitespace changes
Inline
Side-by-side
Showing
64 changed files
with
157 additions
and
146 deletions
+157
-146
cms/conftest.py
+1
-0
cms/djangoapps/api/v1/tests/test_serializers/test_course_runs.py
+4
-3
cms/djangoapps/api/v1/tests/test_views/test_course_runs.py
+5
-4
cms/djangoapps/api/v1/views/course_runs.py
+1
-0
cms/djangoapps/contentstore/admin.py
+1
-1
cms/djangoapps/contentstore/api/tests/test_views.py
+2
-2
cms/djangoapps/contentstore/api/views.py
+3
-6
cms/djangoapps/contentstore/config/forms.py
+2
-3
cms/djangoapps/contentstore/config/models.py
+1
-0
cms/djangoapps/contentstore/config/tests/utils.py
+1
-1
cms/djangoapps/contentstore/courseware_index.py
+1
-1
cms/djangoapps/contentstore/features/courses.py
+0
-1
cms/djangoapps/contentstore/management/commands/clean_cert_name.py
+2
-2
cms/djangoapps/contentstore/management/commands/create_course.py
+1
-3
cms/djangoapps/contentstore/management/commands/delete_course.py
+2
-1
cms/djangoapps/contentstore/management/commands/export.py
+1
-0
cms/djangoapps/contentstore/management/commands/export_all_courses.py
+1
-1
cms/djangoapps/contentstore/management/commands/fix_not_found.py
+0
-1
cms/djangoapps/contentstore/management/commands/force_publish.py
+0
-1
cms/djangoapps/contentstore/management/commands/generate_courses.py
+1
-1
cms/djangoapps/contentstore/management/commands/git_export.py
+1
-1
cms/djangoapps/contentstore/management/commands/import.py
+1
-0
cms/djangoapps/contentstore/management/commands/reindex_library.py
+1
-0
cms/djangoapps/contentstore/management/commands/tests/test_cleanup_assets.py
+3
-3
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
+1
-1
cms/djangoapps/contentstore/management/commands/tests/test_delete_course.py
+1
-1
cms/djangoapps/contentstore/management/commands/tests/test_delete_orphans.py
+3
-3
cms/djangoapps/contentstore/management/commands/tests/test_export.py
+5
-4
cms/djangoapps/contentstore/management/commands/tests/test_export_all_courses.py
+0
-1
cms/djangoapps/contentstore/management/commands/tests/test_export_olx.py
+6
-6
cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py
+1
-0
cms/djangoapps/contentstore/management/commands/tests/test_force_publish.py
+5
-4
cms/djangoapps/contentstore/management/commands/tests/test_git_export.py
+2
-2
cms/djangoapps/contentstore/management/commands/tests/test_import.py
+2
-2
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
+3
-2
cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py
+3
-4
cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py
+4
-6
cms/djangoapps/contentstore/management/commands/xlint.py
+1
-0
cms/djangoapps/contentstore/push_notification.py
+3
-3
cms/djangoapps/contentstore/signals/handlers.py
+2
-2
cms/djangoapps/contentstore/tests/test_contentstore.py
+1
-1
cms/djangoapps/contentstore/tests/test_course_settings.py
+3
-3
cms/djangoapps/contentstore/tests/test_signals.py
+2
-5
cms/djangoapps/contentstore/tests/test_transcripts_utils.py
+1
-1
cms/djangoapps/contentstore/tests/tests.py
+2
-1
cms/djangoapps/contentstore/views/assets.py
+6
-6
cms/djangoapps/contentstore/views/certificates.py
+1
-1
cms/djangoapps/contentstore/views/course.py
+3
-3
cms/djangoapps/contentstore/views/import_export.py
+1
-1
cms/djangoapps/contentstore/views/item.py
+1
-1
cms/djangoapps/contentstore/views/public.py
+3
-3
cms/djangoapps/contentstore/views/tests/test_course_index.py
+1
-1
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
+7
-6
cms/djangoapps/contentstore/views/tests/test_item.py
+1
-1
cms/djangoapps/contentstore/views/tests/test_transcript_settings.py
+2
-2
cms/djangoapps/contentstore/views/tests/test_transcripts.py
+2
-2
cms/djangoapps/contentstore/views/tests/test_videos.py
+15
-8
cms/djangoapps/contentstore/views/transcript_settings.py
+2
-6
cms/djangoapps/contentstore/views/transcripts_ajax.py
+5
-5
cms/djangoapps/models/settings/course_grading.py
+3
-2
cms/djangoapps/pipeline_js/urls.py
+2
-1
cms/lib/xblock/test/test_authoring_mixin.py
+4
-2
cms/urls.py
+1
-1
cms/wsgi.py
+10
-6
No files found.
cms/conftest.py
View file @
e0ef561c
...
...
@@ -10,6 +10,7 @@ from __future__ import absolute_import, unicode_literals
import
importlib
import
os
import
contracts
import
pytest
...
...
cms/djangoapps/api/v1/tests/test_serializers/test_course_runs.py
View file @
e0ef561c
...
...
@@ -3,14 +3,15 @@ import datetime
import
ddt
import
pytz
from
django.test
import
RequestFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
openedx.core.lib.courses
import
course_image_url
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
from
student.tests.factories
import
UserFactory
from
..utils
import
serialize_datetime
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
...serializers.course_runs
import
CourseRunSerializer
from
..utils
import
serialize_datetime
@ddt.ddt
...
...
cms/djangoapps/api/v1/tests/test_views/test_course_runs.py
View file @
e0ef561c
...
...
@@ -7,6 +7,10 @@ from django.core.urlresolvers import reverse
from
django.test
import
RequestFactory
from
opaque_keys.edx.keys
import
CourseKey
from
rest_framework.test
import
APIClient
from
openedx.core.lib.courses
import
course_image_url
from
student.models
import
CourseAccessRole
from
student.tests.factories
import
TEST_PASSWORD
,
AdminFactory
,
UserFactory
from
xmodule.contentstore.content
import
StaticContent
from
xmodule.contentstore.django
import
contentstore
from
xmodule.exceptions
import
NotFoundError
...
...
@@ -14,11 +18,8 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ToyCourseFactory
from
openedx.core.lib.courses
import
course_image_url
from
student.models
import
CourseAccessRole
from
student.tests.factories
import
AdminFactory
,
TEST_PASSWORD
,
UserFactory
from
..utils
import
serialize_datetime
from
...serializers.course_runs
import
CourseRunSerializer
from
..utils
import
serialize_datetime
@ddt.ddt
...
...
cms/djangoapps/api/v1/views/course_runs.py
View file @
e0ef561c
...
...
@@ -8,6 +8,7 @@ from rest_framework.decorators import detail_route
from
rest_framework.response
import
Response
from
contentstore.views.course
import
_accessible_courses_iter
,
get_course_and_check_access
from
..serializers.course_runs
import
(
CourseRunCreateSerializer
,
CourseRunImageSerializer
,
...
...
cms/djangoapps/contentstore/admin.py
View file @
e0ef561c
...
...
@@ -6,7 +6,7 @@ from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModel
from
django.contrib
import
admin
from
contentstore.config.forms
import
CourseNewAssetsPageAdminForm
from
contentstore.config.models
import
NewAssetsPageFlag
,
Course
NewAssetsPageFlag
from
contentstore.config.models
import
CourseNewAssetsPageFlag
,
NewAssetsPageFlag
from
contentstore.models
import
PushNotificationConfig
,
VideoUploadConfig
...
...
cms/djangoapps/contentstore/api/tests/test_views.py
View file @
e0ef561c
...
...
@@ -9,14 +9,14 @@ from datetime import datetime
from
urllib
import
urlencode
from
django.core.urlresolvers
import
reverse
from
path
import
Path
as
path
from
mock
import
patch
from
path
import
Path
as
path
from
rest_framework
import
status
from
rest_framework.test
import
APITestCase
from
user_tasks.models
import
UserTaskStatus
from
lms.djangoapps.courseware.tests.factories
import
GlobalStaffFactory
,
StaffFactory
from
student.tests.factories
import
UserFactory
from
user_tasks.models
import
UserTaskStatus
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_SPLIT_MODULESTORE
,
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
...
...
cms/djangoapps/contentstore/api/views.py
View file @
e0ef561c
...
...
@@ -3,24 +3,21 @@ import base64
import
logging
import
os
from
path
import
Path
as
path
from
six
import
text_type
from
django.conf
import
settings
from
django.core.files
import
File
from
opaque_keys.edx.keys
import
CourseKey
from
path
import
Path
as
path
from
rest_framework
import
status
from
rest_framework.exceptions
import
AuthenticationFailed
from
rest_framework.generics
import
GenericAPIView
from
rest_framework.response
import
Response
from
six
import
text_type
from
user_tasks.models
import
UserTaskStatus
from
student.auth
import
has_course_author_access
from
contentstore.storage
import
course_import_export_storage
from
contentstore.tasks
import
CourseImportTask
,
import_olx
from
openedx.core.lib.api.view_utils
import
DeveloperErrorViewMixin
,
view_auth_classes
from
student.auth
import
has_course_author_access
log
=
logging
.
getLogger
(
__name__
)
...
...
cms/djangoapps/contentstore/config/forms.py
View file @
e0ef561c
...
...
@@ -4,12 +4,11 @@ Defines a form for providing validation.
import
logging
from
django
import
forms
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.locator
import
CourseLocator
from
contentstore.config.models
import
CourseNewAssetsPageFlag
from
opaque_keys
import
InvalidKeyError
from
xmodule.modulestore.django
import
modulestore
from
opaque_keys.edx.locator
import
CourseLocator
log
=
logging
.
getLogger
(
__name__
)
...
...
cms/djangoapps/contentstore/config/models.py
View file @
e0ef561c
...
...
@@ -4,6 +4,7 @@ controlling the new assets page.
"""
from
config_models.models
import
ConfigurationModel
from
django.db.models
import
BooleanField
from
openedx.core.djangoapps.xmodule_django.models
import
CourseKeyField
...
...
cms/djangoapps/contentstore/config/tests/utils.py
View file @
e0ef561c
...
...
@@ -4,7 +4,7 @@ to configure flags related to persistent grading.
"""
from
contextlib
import
contextmanager
from
contentstore.config.models
import
NewAssetsPageFlag
,
Course
NewAssetsPageFlag
from
contentstore.config.models
import
CourseNewAssetsPageFlag
,
NewAssetsPageFlag
from
request_cache.middleware
import
RequestCache
...
...
cms/djangoapps/contentstore/courseware_index.py
View file @
e0ef561c
...
...
@@ -10,12 +10,12 @@ from django.conf import settings
from
django.core.urlresolvers
import
resolve
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext_lazy
from
eventtracking
import
tracker
from
search.search_engine_base
import
SearchEngine
from
six
import
add_metaclass
from
contentstore.course_group_config
import
GroupConfiguration
from
course_modes.models
import
CourseMode
from
eventtracking
import
tracker
from
openedx.core.lib.courses
import
course_image_url
from
xmodule.annotator_mixin
import
html_to_text
from
xmodule.library_tools
import
normalize_key_for_search
...
...
cms/djangoapps/contentstore/features/courses.py
View file @
e0ef561c
...
...
@@ -6,7 +6,6 @@ from lettuce import step, world
from
common
import
*
############### ACTIONS ####################
...
...
cms/djangoapps/contentstore/management/commands/clean_cert_name.py
View file @
e0ef561c
...
...
@@ -4,11 +4,11 @@ erroneous certificate names.
"""
from
collections
import
namedtuple
from
six.moves
import
input
from
six
import
text_type
from
django.core.management.base
import
BaseCommand
from
six
import
text_type
from
six.moves
import
input
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
...
...
cms/djangoapps/contentstore/management/commands/create_course.py
View file @
e0ef561c
"""
Django management command to create a course in a specific modulestore
"""
from
six
import
text_type
from
django.contrib.auth.models
import
User
from
django.core.management.base
import
BaseCommand
,
CommandError
from
six
import
text_type
from
contentstore.management.commands.utils
import
user_from_str
from
contentstore.views.course
import
create_new_course_in_store
from
xmodule.modulestore
import
ModuleStoreEnum
MODULESTORE_CHOICES
=
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
...
...
cms/djangoapps/contentstore/management/commands/delete_course.py
View file @
e0ef561c
from
__future__
import
print_function
from
six
import
text_type
from
django.core.management.base
import
BaseCommand
,
CommandError
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
six
import
text_type
from
contentstore.utils
import
delete_course
from
xmodule.contentstore.django
import
contentstore
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
.prompt
import
query_yes_no
...
...
cms/djangoapps/contentstore/management/commands/export.py
View file @
e0ef561c
...
...
@@ -2,6 +2,7 @@
Script for exporting courseware from Mongo to a tar.gz file
"""
from
__future__
import
print_function
import
os
from
django.core.management.base
import
BaseCommand
,
CommandError
...
...
cms/djangoapps/contentstore/management/commands/export_all_courses.py
View file @
e0ef561c
...
...
@@ -2,9 +2,9 @@
Script for exporting all courseware from Mongo to a directory and listing the courses which failed to export
"""
from
__future__
import
print_function
from
six
import
text_type
from
django.core.management.base
import
BaseCommand
from
six
import
text_type
from
xmodule.contentstore.django
import
contentstore
from
xmodule.modulestore.django
import
modulestore
...
...
cms/djangoapps/contentstore/management/commands/fix_not_found.py
View file @
e0ef561c
...
...
@@ -7,7 +7,6 @@ from opaque_keys.edx.keys import CourseKey
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
# To run from command line: ./manage.py cms fix_not_found course-v1:org+course+run
...
...
cms/djangoapps/contentstore/management/commands/force_publish.py
View file @
e0ef561c
...
...
@@ -11,7 +11,6 @@ from xmodule.modulestore.django import modulestore
from
.prompt
import
query_yes_no
from
.utils
import
get_course_versions
# To run from command line: ./manage.py cms force_publish course-v1:org+course+run
...
...
cms/djangoapps/contentstore/management/commands/generate_courses.py
View file @
e0ef561c
...
...
@@ -3,10 +3,10 @@ Django management command to generate a test course from a course config json
"""
import
json
import
logging
from
six
import
text_type
from
django.contrib.auth.models
import
User
from
django.core.management.base
import
BaseCommand
,
CommandError
from
six
import
text_type
from
contentstore.management.commands.utils
import
user_from_str
from
contentstore.views.course
import
create_new_course_in_store
...
...
cms/djangoapps/contentstore/management/commands/git_export.py
View file @
e0ef561c
...
...
@@ -14,12 +14,12 @@ attribute is set and the FEATURE['ENABLE_EXPORT_GIT'] is set.
"""
import
logging
from
six
import
text_type
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.utils.translation
import
ugettext
as
_
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
six
import
text_type
import
contentstore.git_export_utils
as
git_export_utils
from
contentstore.git_export_utils
import
GitExportError
...
...
cms/djangoapps/contentstore/management/commands/import.py
View file @
e0ef561c
...
...
@@ -2,6 +2,7 @@
Script for importing courseware from XML format
"""
from
django.core.management.base
import
BaseCommand
from
django_comment_common.utils
import
are_permissions_roles_seeded
,
seed_permissions_roles
from
xmodule.contentstore.django
import
contentstore
from
xmodule.modulestore
import
ModuleStoreEnum
...
...
cms/djangoapps/contentstore/management/commands/reindex_library.py
View file @
e0ef561c
""" Management command to update libraries' search index """
from
__future__
import
print_function
from
textwrap
import
dedent
from
django.core.management
import
BaseCommand
,
CommandError
...
...
cms/djangoapps/contentstore/management/commands/tests/test_cleanup_assets.py
View file @
e0ef561c
...
...
@@ -2,17 +2,17 @@
Test for assets cleanup of courses for Mac OS metadata files (with filename ".DS_Store"
or with filename which starts with "._")
"""
from
django.conf
import
settings
from
django.core.management
import
call_command
from
opaque_keys.edx.keys
import
CourseKey
from
xmodule.contentstore.content
import
XASSET_LOCATION_TAG
from
xmodule.contentstore.django
import
contentstore
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.mongo.base
import
location_to_query
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.xml_importer
import
import_course_from_xml
from
django.conf
import
settings
TEST_DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
...
...
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
View file @
e0ef561c
...
...
@@ -6,8 +6,8 @@ from django.core.management import CommandError, call_command
from
django.test
import
TestCase
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
class
TestArgParsing
(
TestCase
):
...
...
cms/djangoapps/contentstore/management/commands/tests/test_delete_course.py
View file @
e0ef561c
...
...
@@ -6,7 +6,7 @@ from student.tests.factories import UserFactory
from
xmodule.contentstore.content
import
StaticContent
from
xmodule.contentstore.django
import
contentstore
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
TEST_DATA_SPLIT_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_SPLIT_MODULESTORE
,
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
...
...
cms/djangoapps/contentstore/management/commands/tests/test_delete_orphans.py
View file @
e0ef561c
"""Tests running the delete_orphan command"""
import
ddt
from
django.core.management
import
call_command
,
CommandError
from
contentstore.tests.test_orphan
import
TestOrphanBase
from
django.core.management
import
CommandError
,
call_command
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
contentstore.tests.test_orphan
import
TestOrphanBase
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.factories
import
CourseFactory
@ddt.ddt
...
...
cms/djangoapps/contentstore/management/commands/tests/test_export.py
View file @
e0ef561c
"""
Tests for exporting courseware to the desired path
"""
import
unittest
import
shutil
import
unittest
from
tempfile
import
mkdtemp
import
ddt
from
django.core.management
import
CommandError
,
call_command
from
tempfile
import
mkdtemp
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
class
TestArgParsingCourseExport
(
unittest
.
TestCase
):
...
...
cms/djangoapps/contentstore/management/commands/tests/test_export_all_courses.py
View file @
e0ef561c
...
...
@@ -5,7 +5,6 @@ import shutil
from
tempfile
import
mkdtemp
from
contentstore.management.commands.export_all_courses
import
export_courses_to_output_path
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
cms/djangoapps/contentstore/management/commands/tests/test_export_olx.py
View file @
e0ef561c
...
...
@@ -2,20 +2,20 @@
Tests for exporting OLX content.
"""
import
ddt
from
path
import
Path
as
path
import
shutil
from
StringIO
import
StringIO
import
tarfile
from
tempfile
import
mkdtemp
import
unittest
from
StringIO
import
StringIO
from
tempfile
import
mkdtemp
import
ddt
from
django.core.management
import
CommandError
,
call_command
from
path
import
Path
as
path
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
class
TestArgParsingCourseExportOlx
(
unittest
.
TestCase
):
...
...
cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py
View file @
e0ef561c
...
...
@@ -3,6 +3,7 @@ Tests for the fix_not_found management command
"""
from
django.core.management
import
CommandError
,
call_command
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
...
...
cms/djangoapps/contentstore/management/commands/tests/test_force_publish.py
View file @
e0ef561c
...
...
@@ -2,12 +2,13 @@
Tests for the force_publish management command
"""
import
mock
from
django.core.management
import
call_command
,
CommandError
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
,
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
django.core.management
import
CommandError
,
call_command
from
contentstore.management.commands.force_publish
import
Command
from
contentstore.management.commands.utils
import
get_course_versions
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
,
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
class
TestForcePublish
(
SharedModuleStoreTestCase
):
...
...
cms/djangoapps/contentstore/management/commands/tests/test_git_export.py
View file @
e0ef561c
...
...
@@ -14,11 +14,11 @@ from django.conf import settings
from
django.core.management
import
call_command
from
django.core.management.base
import
CommandError
from
django.test.utils
import
override_settings
from
opaque_keys.edx.locator
import
CourseLocator
from
contentstore.tests.utils
import
CourseTestCase
import
contentstore.git_export_utils
as
git_export_utils
from
contentstore.git_export_utils
import
GitExportError
from
opaque_keys.edx.locator
import
CourseLocator
from
contentstore.tests.utils
import
CourseTestCase
FEATURES_WITH_EXPORT_GIT
=
settings
.
FEATURES
.
copy
()
FEATURES_WITH_EXPORT_GIT
[
'ENABLE_EXPORT_GIT'
]
=
True
...
...
cms/djangoapps/contentstore/management/commands/tests/test_import.py
View file @
e0ef561c
...
...
@@ -3,15 +3,15 @@ Unittests for importing a course via management command
"""
import
os
from
path
import
Path
as
path
import
shutil
import
tempfile
from
django.core.management
import
call_command
from
path
import
Path
as
path
from
django_comment_common.utils
import
are_permissions_roles_seeded
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
View file @
e0ef561c
...
...
@@ -3,11 +3,12 @@ Unittests for migrating a course to split mongo
"""
from
django.core.management
import
CommandError
,
call_command
from
django.test
import
TestCase
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
class
TestArgParsing
(
TestCase
):
...
...
cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py
View file @
e0ef561c
""" Tests for course reindex command """
import
ddt
from
django.core.management
import
call_command
,
CommandError
import
mock
from
django.core.management
import
CommandError
,
call_command
from
six
import
text_type
from
contentstore.courseware_index
import
SearchIndexingError
from
contentstore.management.commands.reindex_course
import
Command
as
ReindexCommand
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
LibraryFactory
from
contentstore.management.commands.reindex_course
import
Command
as
ReindexCommand
from
contentstore.courseware_index
import
SearchIndexingError
@ddt.ddt
class
TestReindexCourse
(
ModuleStoreTestCase
):
...
...
cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py
View file @
e0ef561c
""" Tests for library reindex command """
import
ddt
from
django.core.management
import
call_command
,
CommandError
import
mock
from
django.core.management
import
CommandError
,
call_command
from
opaque_keys
import
InvalidKeyError
from
contentstore.courseware_index
import
SearchIndexingError
from
contentstore.management.commands.reindex_library
import
Command
as
ReindexCommand
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
LibraryFactory
from
opaque_keys
import
InvalidKeyError
from
contentstore.management.commands.reindex_library
import
Command
as
ReindexCommand
from
contentstore.courseware_index
import
SearchIndexingError
@ddt.ddt
class
TestReindexLibrary
(
ModuleStoreTestCase
):
...
...
cms/djangoapps/contentstore/management/commands/xlint.py
View file @
e0ef561c
...
...
@@ -2,6 +2,7 @@
Verify the structure of courseware as to it's suitability for import
"""
from
__future__
import
print_function
from
argparse
import
REMAINDER
from
django.core.management.base
import
BaseCommand
...
...
cms/djangoapps/contentstore/push_notification.py
View file @
e0ef561c
...
...
@@ -6,12 +6,12 @@ from logging import exception as log_exception
from
uuid
import
uuid4
from
django.conf
import
settings
from
contentstore.models
import
PushNotificationConfig
from
contentstore.tasks
import
push_course_update_task
from
parse_rest.connection
import
register
from
parse_rest.core
import
ParseError
from
parse_rest.installation
import
Push
from
contentstore.models
import
PushNotificationConfig
from
contentstore.tasks
import
push_course_update_task
from
xmodule.modulestore.django
import
modulestore
...
...
cms/djangoapps/contentstore/signals/handlers.py
View file @
e0ef561c
""" receivers of course_published and library_updated events in order to trigger indexing task """
import
logging
from
datetime
import
datetime
from
functools
import
wraps
import
logging
from
django.core.cache
import
cache
from
django.dispatch
import
receiver
...
...
@@ -15,9 +15,9 @@ from openedx.core.djangoapps.credit.signals import on_course_publish
from
openedx.core.lib.gating
import
api
as
gating_api
from
track.event_transaction_utils
import
get_event_transaction_id
,
get_event_transaction_type
from
util.module_utils
import
yield_dynamic_descriptor_descendants
from
.signals
import
GRADING_POLICY_CHANGED
from
xmodule.modulestore.django
import
SignalHandler
,
modulestore
from
.signals
import
GRADING_POLICY_CHANGED
log
=
logging
.
getLogger
(
__name__
)
...
...
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
e0ef561c
...
...
@@ -25,10 +25,10 @@ from opaque_keys.edx.locations import AssetLocation, CourseLocator
from
path
import
Path
as
path
from
waffle.testutils
import
override_switch
from
contentstore.config
import
waffle
from
contentstore.tests.utils
import
AjaxEnabledTestClient
,
CourseTestCase
,
get_url
,
parse_json
from
contentstore.utils
import
delete_course
,
reverse_course_url
,
reverse_url
from
contentstore.views.component
import
ADVANCED_COMPONENT_TYPES
from
contentstore.config
import
waffle
from
course_action_state.managers
import
CourseActionStateItemNotFoundError
from
course_action_state.models
import
CourseRerunState
,
CourseRerunUIStateManager
from
django_comment_common.utils
import
are_permissions_roles_seeded
...
...
cms/djangoapps/contentstore/tests/test_course_settings.py
View file @
e0ef561c
...
...
@@ -10,13 +10,13 @@ import ddt
import
mock
from
django.conf
import
settings
from
django.test.utils
import
override_settings
from
pytz
import
UTC
from
milestones.models
import
MilestoneRelationshipType
from
milestones.tests.utils
import
MilestonesTestCaseMixin
from
mock
import
Mock
,
patch
from
pytz
import
UTC
from
contentstore.utils
import
reverse_course_url
,
reverse_usage_url
from
milestones.models
import
MilestoneRelationshipType
from
models.settings.course_grading
import
CourseGradingModel
,
GRADING_POLICY_CHANGED_EVENT_TYPE
,
hash_grading_policy
from
models.settings.course_grading
import
GRADING_POLICY_CHANGED_EVENT_TYPE
,
CourseGradingModel
,
hash_grading_policy
from
models.settings.course_metadata
import
CourseMetadata
from
models.settings.encoder
import
CourseSettingsEncoder
from
openedx.core.djangoapps.models.course_details
import
CourseDetails
...
...
cms/djangoapps/contentstore/tests/test_signals.py
View file @
e0ef561c
import
ddt
from
mock
import
patch
,
Mock
from
mock
import
Mock
,
patch
from
cms.djangoapps.contentstore.signals.handlers
import
(
GRADING_POLICY_COUNTDOWN_SECONDS
,
handle_grading_policy_changed
)
from
cms.djangoapps.contentstore.signals.handlers
import
GRADING_POLICY_COUNTDOWN_SECONDS
,
handle_grading_policy_changed
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
cms/djangoapps/contentstore/tests/test_transcripts_utils.py
View file @
e0ef561c
# -*- coding: utf-8 -*-
""" Tests for transcripts_utils. """
import
copy
import
ddt
import
textwrap
import
unittest
from
uuid
import
uuid4
import
ddt
from
django.conf
import
settings
from
django.test.utils
import
override_settings
from
django.utils
import
translation
...
...
cms/djangoapps/contentstore/tests/tests.py
View file @
e0ef561c
...
...
@@ -2,6 +2,7 @@
This test file will test registration, login, activation, and session activity timeouts
"""
from
__future__
import
print_function
import
datetime
import
time
...
...
@@ -16,11 +17,11 @@ from django.test import TestCase
from
django.test.utils
import
override_settings
from
freezegun
import
freeze_time
from
pytz
import
UTC
from
six.moves
import
xrange
from
contentstore.models
import
PushNotificationConfig
from
contentstore.tests.test_course_settings
import
CourseTestCase
from
contentstore.tests.utils
import
AjaxEnabledTestClient
,
parse_json
,
registration
,
user
from
six.moves
import
xrange
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
...
...
cms/djangoapps/contentstore/views/assets.py
View file @
e0ef561c
...
...
@@ -9,14 +9,9 @@ from django.core.exceptions import PermissionDenied
from
django.http
import
HttpResponseBadRequest
,
HttpResponseNotFound
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
django.views.decorators.http
import
require_
POST
,
require_http_methods
from
django.views.decorators.http
import
require_
http_methods
,
require_POST
from
opaque_keys.edx.keys
import
AssetKey
,
CourseKey
from
pymongo
import
ASCENDING
,
DESCENDING
from
xmodule.contentstore.content
import
StaticContent
from
xmodule.contentstore.django
import
contentstore
from
xmodule.exceptions
import
NotFoundError
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
contentstore.config.models
import
NewAssetsPageFlag
from
contentstore.utils
import
reverse_course_url
...
...
@@ -26,6 +21,11 @@ from openedx.core.djangoapps.contentserver.caching import del_cached_content
from
student.auth
import
has_course_author_access
from
util.date_utils
import
get_default_time_display
from
util.json_request
import
JsonResponse
from
xmodule.contentstore.content
import
StaticContent
from
xmodule.contentstore.django
import
contentstore
from
xmodule.exceptions
import
NotFoundError
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
__all__
=
[
'assets_handler'
]
...
...
cms/djangoapps/contentstore/views/certificates.py
View file @
e0ef561c
...
...
@@ -31,6 +31,7 @@ from django.http import HttpResponse
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
django.views.decorators.http
import
require_http_methods
from
eventtracking
import
tracker
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
AssetKey
,
CourseKey
...
...
@@ -39,7 +40,6 @@ from contentstore.views.assets import delete_asset
from
contentstore.views.exception
import
AssetNotFoundException
from
course_modes.models
import
CourseMode
from
edxmako.shortcuts
import
render_to_response
from
eventtracking
import
tracker
from
student.auth
import
has_studio_write_access
from
student.roles
import
GlobalStaff
from
util.db
import
MYSQL_MAX_INT
,
generate_int_id
...
...
cms/djangoapps/contentstore/views/course.py
View file @
e0ef561c
...
...
@@ -19,11 +19,10 @@ from django.shortcuts import redirect
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
django.views.decorators.http
import
require_GET
,
require_http_methods
from
milestones
import
api
as
milestones_api
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.locations
import
Location
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.waffle_utils
import
WaffleSwitchNamespace
from
contentstore.course_group_config
import
(
COHORT_SCHEME
,
...
...
@@ -51,16 +50,17 @@ from course_action_state.managers import CourseActionStateItemNotFoundError
from
course_action_state.models
import
CourseRerunState
,
CourseRerunUIStateManager
from
course_creators.views
import
add_user_with_status_unrequested
,
get_course_creator_status
from
edxmako.shortcuts
import
render_to_response
from
milestones
import
api
as
milestones_api
from
models.settings.course_grading
import
CourseGradingModel
from
models.settings.course_metadata
import
CourseMetadata
from
models.settings.encoder
import
CourseSettingsEncoder
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.content.course_structures.api.v0
import
api
,
errors
from
openedx.core.djangoapps.credit.api
import
get_credit_requirements
,
is_credit_course
from
openedx.core.djangoapps.credit.tasks
import
update_credit_course_requirements
from
openedx.core.djangoapps.models.course_details
import
CourseDetails
from
openedx.core.djangoapps.self_paced.models
import
SelfPacedConfiguration
from
openedx.core.djangoapps.site_configuration
import
helpers
as
configuration_helpers
from
openedx.core.djangoapps.waffle_utils
import
WaffleSwitchNamespace
from
openedx.core.djangolib.js_utils
import
dump_js_escaped_json
from
openedx.core.lib.course_tabs
import
CourseTabPluginManager
from
openedx.core.lib.courses
import
course_image_url
...
...
cms/djangoapps/contentstore/views/import_export.py
View file @
e0ef561c
...
...
@@ -8,6 +8,7 @@ import logging
import
os
import
re
import
shutil
from
wsgiref.util
import
FileWrapper
from
django.conf
import
settings
from
django.contrib.auth.decorators
import
login_required
...
...
@@ -24,7 +25,6 @@ from path import Path as path
from
six
import
text_type
from
user_tasks.conf
import
settings
as
user_tasks_settings
from
user_tasks.models
import
UserTaskArtifact
,
UserTaskStatus
from
wsgiref.util
import
FileWrapper
from
contentstore.storage
import
course_import_export_storage
from
contentstore.tasks
import
CourseExportTask
,
CourseImportTask
,
export_olx
,
import_olx
...
...
cms/djangoapps/contentstore/views/item.py
View file @
e0ef561c
...
...
@@ -15,6 +15,7 @@ from django.core.exceptions import PermissionDenied
from
django.http
import
Http404
,
HttpResponse
,
HttpResponseBadRequest
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.http
import
require_http_methods
from
help_tokens.core
import
HelpUrlExpert
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.locator
import
LibraryUsageLocator
from
pytz
import
UTC
...
...
@@ -46,7 +47,6 @@ from contentstore.views.helpers import (
)
from
contentstore.views.preview
import
get_preview_fragment
from
edxmako.shortcuts
import
render_to_string
from
help_tokens.core
import
HelpUrlExpert
from
models.settings.course_grading
import
CourseGradingModel
from
openedx.core.djangoapps.schedules.config
import
COURSE_UPDATE_WAFFLE_FLAG
from
openedx.core.djangoapps.waffle_utils
import
WaffleSwitch
...
...
cms/djangoapps/contentstore/views/public.py
View file @
e0ef561c
...
...
@@ -2,17 +2,17 @@
Public views
"""
from
django.conf
import
settings
from
django.template.context_processors
import
csrf
from
django.core.urlresolvers
import
reverse
from
django.shortcuts
import
redirect
from
django.template.context_processors
import
csrf
from
django.views.decorators.clickjacking
import
xframe_options_deny
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
waffle.decorators
import
waffle_switch
from
contentstore.config
import
waffle
from
edxmako.shortcuts
import
render_to_response
from
openedx.core.djangoapps.external_auth.views
import
redirect_with_get
,
ssl_get_cert_from_request
,
ssl_login_shortcut
from
openedx.core.djangoapps.site_configuration
import
helpers
as
configuration_helpers
from
waffle.decorators
import
waffle_switch
from
contentstore.config
import
waffle
__all__
=
[
'signup'
,
'login_page'
,
'howitworks'
,
'accessibility'
]
...
...
cms/djangoapps/contentstore/views/tests/test_course_index.py
View file @
e0ef561c
...
...
@@ -18,12 +18,12 @@ from search.api import perform_search
from
contentstore.courseware_index
import
CoursewareSearchIndexer
,
SearchIndexingError
from
contentstore.tests.utils
import
CourseTestCase
from
contentstore.utils
import
add_instructor
,
reverse_course_url
,
reverse_usage_url
from
contentstore.views.course
import
WAFFLE_NAMESPACE
as
COURSE_WAFFLE_NAMESPACE
from
contentstore.views.course
import
(
_deprecated_blocks_info
,
course_outline_initial_state
,
reindex_course_and_check_access
)
from
contentstore.views.course
import
WAFFLE_NAMESPACE
as
COURSE_WAFFLE_NAMESPACE
from
contentstore.views.item
import
VisibilityState
,
create_xblock_info
from
course_action_state.managers
import
CourseRerunUIStateManager
from
course_action_state.models
import
CourseRerunState
...
...
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
View file @
e0ef561c
...
...
@@ -4,18 +4,19 @@
Group Configuration Tests.
"""
import
json
from
operator
import
itemgetter
import
ddt
from
mock
import
patch
from
operator
import
itemgetter
from
contentstore.utils
import
reverse_course_url
,
reverse_usage_url
from
contentstore.course_group_config
import
GroupConfiguration
,
CONTENT_GROUP_CONFIGURATION_NAME
from
contentstore.course_group_config
import
CONTENT_GROUP_CONFIGURATION_NAME
,
GroupConfiguration
from
contentstore.tests.utils
import
CourseTestCase
from
xmodule.partitions.partitions
import
Group
,
UserPartition
from
contentstore.utils
import
reverse_course_url
,
reverse_usage_url
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.partitions.partitions
import
Group
,
UserPartition
from
xmodule.validation
import
StudioValidation
,
StudioValidationMessage
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore
import
ModuleStoreEnum
GROUP_CONFIGURATION_JSON
=
{
u'name'
:
u'Test name'
,
...
...
cms/djangoapps/contentstore/views/tests/test_item.py
View file @
e0ef561c
...
...
@@ -34,7 +34,7 @@ from contentstore.views.item import (
_xblock_type_and_display_name
,
add_container_page_publishing_info
,
create_xblock_info
,
highlights_setting
,
highlights_setting
)
from
lms_xblock.mixin
import
NONSENSICAL_ACCESS_RESTRICTION
from
openedx.core.djangoapps.self_paced.models
import
SelfPacedConfiguration
...
...
cms/djangoapps/contentstore/views/tests/test_transcript_settings.py
View file @
e0ef561c
import
ddt
import
json
from
mock
import
Mock
,
patch
import
ddt
from
django.test.testcases
import
TestCase
from
mock
import
Mock
,
patch
from
contentstore.tests.utils
import
CourseTestCase
from
contentstore.utils
import
reverse_course_url
...
...
cms/djangoapps/contentstore/views/tests/test_transcripts.py
View file @
e0ef561c
"""Tests for items views."""
import
copy
import
ddt
import
json
import
os
import
tempfile
import
textwrap
from
uuid
import
uuid4
import
ddt
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.test.utils
import
override_settings
from
mock
import
patch
,
Mock
from
mock
import
Mock
,
patch
from
opaque_keys.edx.keys
import
UsageKey
from
contentstore.tests.utils
import
CourseTestCase
,
mock_requests_get
...
...
cms/djangoapps/contentstore/views/tests/test_videos.py
View file @
e0ef561c
...
...
@@ -15,24 +15,31 @@ import pytz
from
django.conf
import
settings
from
django.core.files.uploadedfile
import
UploadedFile
from
django.test.utils
import
override_settings
from
edxval.api
import
create_profile
,
create_video
,
get_video_info
,
get_course_video_image_url
from
edxval.api
import
(
create_or_update_transcript_preferences
,
create_profile
,
create_video
,
get_course_video_image_url
,
get_transcript_preferences
,
get_video_info
)
from
mock
import
Mock
,
patch
from
contentstore.models
import
VideoUploadConfig
from
contentstore.tests.utils
import
CourseTestCase
from
contentstore.utils
import
reverse_course_url
from
contentstore.views.videos
import
(
_get_default_video_image_url
,
validate_video_image
,
KEY_EXPIRATION_IN_SECONDS
,
VIDEO_IMAGE_UPLOAD_ENABLED
,
WAFFLE_SWITCHES
,
TranscriptProvider
StatusDisplayStrings
,
TranscriptProvider
,
_get_default_video_image_url
,
convert_video_status
,
validate_video_image
)
from
contentstore.views.videos
import
KEY_EXPIRATION_IN_SECONDS
,
StatusDisplayStrings
,
convert_video_status
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
openedx.core.djangoapps.profile_images.tests.helpers
import
make_image_file
from
edxval.api
import
create_or_update_transcript_preferences
,
get_transcript_preferences
from
xmodule.modulestore.tests.factories
import
CourseFactory
def
override_switch
(
switch
,
active
):
...
...
cms/djangoapps/contentstore/views/transcript_settings.py
View file @
e0ef561c
...
...
@@ -5,18 +5,14 @@ from django.contrib.auth.decorators import login_required
from
django.http
import
HttpResponseNotFound
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.http
import
require_POST
from
edxval.api
import
(
get_3rd_party_transcription_plans
,
update_transcript_credentials_state_for_org
,
)
from
edxval.api
import
get_3rd_party_transcription_plans
,
update_transcript_credentials_state_for_org
from
opaque_keys.edx.keys
import
CourseKey
from
contentstore.views.videos
import
TranscriptProvider
from
openedx.core.djangoapps.video_config.models
import
VideoTranscriptEnabledFlag
from
openedx.core.djangoapps.video_pipeline.api
import
update_3rd_party_transcription_service_credentials
from
util.json_request
import
JsonResponse
,
expect_json
from
contentstore.views.videos
import
TranscriptProvider
__all__
=
[
'transcript_credentials_handler'
]
...
...
cms/djangoapps/contentstore/views/transcripts_ajax.py
View file @
e0ef561c
...
...
@@ -27,17 +27,17 @@ from xmodule.exceptions import NotFoundError
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.video_module.transcripts_utils
import
(
GetTranscriptsFromYouTubeException
,
Transcript
,
TranscriptsRequestValidationException
,
copy_or_rename_transcript
,
download_youtube_subs
,
GetTranscriptsFromYouTubeException
,
get_video_transcript_content
,
generate_subs_from_source
,
get_transcripts_from_youtube
,
get_video_transcript_content
,
manage_video_subtitles_save
,
remove_subs_from_store
,
Transcript
,
TranscriptsRequestValidationException
,
youtube_video_transcript_name
,
youtube_video_transcript_name
)
from
xmodule.video_module.transcripts_model_utils
import
(
is_val_transcript_feature_enabled_for_course
...
...
cms/djangoapps/models/settings/course_grading.py
View file @
e0ef561c
import
json
from
base64
import
b64encode
from
datetime
import
timedelta
from
hashlib
import
sha1
import
json
from
contentstore.signals.signals
import
GRADING_POLICY_CHANGED
from
eventtracking
import
tracker
from
contentstore.signals.signals
import
GRADING_POLICY_CHANGED
from
track.event_transaction_utils
import
create_new_event_transaction_id
from
xmodule.modulestore.django
import
modulestore
...
...
cms/djangoapps/pipeline_js/urls.py
View file @
e0ef561c
...
...
@@ -2,7 +2,8 @@
URL patterns for Javascript files used to load all of the XModule JS in one wad.
"""
from
django.conf.urls
import
url
from
pipeline_js.views
import
xmodule_js_files
,
requirejs_xmodule
from
pipeline_js.views
import
requirejs_xmodule
,
xmodule_js_files
urlpatterns
=
[
url
(
r'^files\.json$'
,
xmodule_js_files
,
name
=
'xmodule_js_files'
),
...
...
cms/lib/xblock/test/test_authoring_mixin.py
View file @
e0ef561c
...
...
@@ -5,11 +5,13 @@ from django.conf import settings
from
django.test.utils
import
override_settings
from
course_modes.tests.factories
import
CourseModeFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.partitions.partitions
import
(
Group
,
UserPartition
,
ENROLLMENT_TRACK_PARTITION_ID
,
MINIMUM_STATIC_PARTITION_ID
ENROLLMENT_TRACK_PARTITION_ID
,
MINIMUM_STATIC_PARTITION_ID
,
Group
,
UserPartition
)
...
...
cms/urls.py
View file @
e0ef561c
...
...
@@ -3,6 +3,7 @@ from django.conf.urls import include, url
from
django.conf.urls.static
import
static
from
django.contrib.admin
import
autodiscover
as
django_autodiscover
from
django.utils.translation
import
ugettext_lazy
as
_
from
ratelimitbackend
import
admin
import
contentstore.views
import
openedx.core.djangoapps.common_views.xblock
...
...
@@ -10,7 +11,6 @@ import openedx.core.djangoapps.debug.views
import
openedx.core.djangoapps.external_auth.views
import
openedx.core.djangoapps.lang_pref.views
from
cms.djangoapps.contentstore.views.organization
import
OrganizationListView
from
ratelimitbackend
import
admin
django_autodiscover
()
admin
.
site
.
site_header
=
_
(
'Studio Administration'
)
...
...
cms/wsgi.py
View file @
e0ef561c
# Patch the xml libs before anything else.
# Patch the xml libs before anything else. Because this makes imports out-of-order, disable pylint errors.
# pylint: disable=wrong-import-order, wrong-import-position
from
safe_lxml
import
defuse_xml_libs
defuse_xml_libs
()
import
os
# Disable PyContract contract checking when running as a webserver
import
contracts
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from
django.core.wsgi
import
get_wsgi_application
import
cms.startup
as
startup
contracts
.
disable_all
()
import
os
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"cms.envs.aws"
)
import
cms.startup
as
startup
startup
.
run
()
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment