chore: Switch to new openedx-learning import paths (#38004)

Upgrades openedx-learning from 0.31.0 to 0.32.0,
incorporating a major openedx-learning Python API
restructuring: ca0b3eb
This commit is contained in:
Kyle McCormick
2026-02-13 15:39:05 -05:00
committed by GitHub
parent d847d222b2
commit a55c1ddabf
65 changed files with 291 additions and 286 deletions

View File

@@ -3,8 +3,8 @@
import django.db.migrations.operations.special
import django.db.models.deletion
import opaque_keys.edx.django.models
import openedx_learning.lib.fields
import openedx_learning.lib.validators
import openedx_django_lib.fields
import openedx_django_lib.validators
import uuid
from django.conf import settings
from django.db import migrations, models
@@ -107,8 +107,8 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('context_key', opaque_keys.edx.django.models.CourseKeyField(help_text='Linking status for course context key', max_length=255, unique=True)),
('status', models.CharField(choices=[('pending', 'Pending'), ('processing', 'Processing'), ('failed', 'Failed'), ('completed', 'Completed')], help_text='Status of links in given learning context/course.', max_length=20)),
('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('created', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
],
options={
'verbose_name': 'Learning Context Links status',
@@ -121,13 +121,13 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')),
('upstream_usage_key', opaque_keys.edx.django.models.UsageKeyField(help_text='Upstream block usage key, this value cannot be null and useful to track upstream library blocks that do not exist yet', max_length=255)),
('upstream_context_key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, help_text='Upstream context key i.e., learning_package/library key', max_length=500)),
('upstream_context_key', openedx_django_lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, help_text='Upstream context key i.e., learning_package/library key', max_length=500)),
('downstream_usage_key', opaque_keys.edx.django.models.UsageKeyField(max_length=255, unique=True)),
('downstream_context_key', opaque_keys.edx.django.models.CourseKeyField(db_index=True, max_length=255)),
('version_synced', models.IntegerField()),
('version_declined', models.IntegerField(blank=True, null=True)),
('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('created', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('upstream_block', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='links', to='openedx_content.component')),
],
options={
@@ -140,13 +140,13 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')),
('upstream_context_key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, help_text='Upstream context key i.e., learning_package/library key', max_length=500)),
('upstream_context_key', openedx_django_lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, help_text='Upstream context key i.e., learning_package/library key', max_length=500)),
('downstream_usage_key', opaque_keys.edx.django.models.UsageKeyField(max_length=255, unique=True)),
('downstream_context_key', opaque_keys.edx.django.models.CourseKeyField(db_index=True, max_length=255)),
('version_synced', models.IntegerField()),
('version_declined', models.IntegerField(blank=True, null=True)),
('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('created', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('upstream_container_key', opaque_keys.edx.django.models.ContainerKeyField(help_text='Upstream block key (e.g. lct:...), this value cannot be null and is useful to track upstream library blocks that do not exist yet or were deleted.', max_length=255)),
('upstream_container', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='links', to='openedx_content.container')),
],

View File

@@ -4,8 +4,8 @@ import uuid
import django.db.models.deletion
import opaque_keys.edx.django.models
import openedx_learning.lib.fields
import openedx_learning.lib.validators
import openedx_django_lib.fields
import openedx_django_lib.validators
from django.db import migrations, models
@@ -39,8 +39,8 @@ class Migration(migrations.Migration):
max_length=20,
),
),
('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('created', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
],
options={
'verbose_name': 'Learning Context Links status',
@@ -61,7 +61,7 @@ class Migration(migrations.Migration):
),
(
'upstream_context_key',
openedx_learning.lib.fields.MultiCollationCharField(
openedx_django_lib.fields.MultiCollationCharField(
db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'},
db_index=True,
help_text='Upstream context key i.e., learning_package/library key',
@@ -72,8 +72,8 @@ class Migration(migrations.Migration):
('downstream_context_key', opaque_keys.edx.django.models.CourseKeyField(db_index=True, max_length=255)),
('version_synced', models.IntegerField()),
('version_declined', models.IntegerField(blank=True, null=True)),
('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('created', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
(
'upstream_block',
models.ForeignKey(

View File

@@ -3,8 +3,8 @@ import uuid
import django.db.models.deletion
import opaque_keys.edx.django.models
import openedx_learning.lib.fields
import openedx_learning.lib.validators
import openedx_django_lib.fields
import openedx_django_lib.validators
from django.db import migrations, models
@@ -40,13 +40,13 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='UUID')),
('upstream_context_key', openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, help_text='Upstream context key i.e., learning_package/library key', max_length=500)),
('upstream_context_key', openedx_django_lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_bin', 'sqlite': 'BINARY'}, db_index=True, help_text='Upstream context key i.e., learning_package/library key', max_length=500)),
('downstream_usage_key', opaque_keys.edx.django.models.UsageKeyField(max_length=255, unique=True)),
('downstream_context_key', opaque_keys.edx.django.models.CourseKeyField(db_index=True, max_length=255)),
('version_synced', models.IntegerField()),
('version_declined', models.IntegerField(blank=True, null=True)),
('created', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_learning.lib.validators.validate_utc_datetime])),
('created', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('updated', models.DateTimeField(validators=[openedx_django_lib.validators.validate_utc_datetime])),
('upstream_container_key', opaque_keys.edx.django.models.ContainerKeyField(help_text='Upstream block key (e.g. lct:...), this value cannot be null and is useful to track upstream library blocks that do not exist yet or were deleted.', max_length=255)),
('upstream_container', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='links', to='oel_publishing.container')),
],

View File

@@ -15,9 +15,9 @@ from django.utils.translation import gettext_lazy as _
from opaque_keys.edx.django.models import ContainerKeyField, CourseKeyField, UsageKeyField
from opaque_keys.edx.keys import CourseKey, UsageKey
from opaque_keys.edx.locator import LibraryContainerLocator
from openedx_learning.api.authoring import get_published_version
from openedx_learning.api.authoring_models import Component, Container
from openedx_learning.lib.fields import (
from openedx_content.api import get_published_version
from openedx_content.models_api import Component, Container
from openedx_django_lib.fields import (
immutable_uuid_field,
key_field,
manual_date_time_field,

View File

@@ -32,13 +32,13 @@ class APIHeartBeatView(DeveloperErrorViewMixin, APIView):
**Response Values**
If the request is successful, an HTTP 200 "OK" response is returned.
The HTTP 200 response contains a single dict with the "authoring_api_enabled" value "True".
The HTTP 200 response contains a single dict with the "content_api_enabled" value "True".
**Example Response**
```json
{
"authoring_api_enabled": "True"
"content_api_enabled": "True"
}
```
"""

View File

@@ -10,7 +10,7 @@ from django.conf import settings
from django.test import override_settings
from django.urls import reverse
from opaque_keys.edx.locator import LibraryLocatorV2
from openedx_learning.api import authoring as authoring_api
from openedx_content import api as content_api
from organizations.tests.factories import OrganizationFactory
from rest_framework import status
@@ -272,7 +272,7 @@ class HomePageLibrariesViewTest(LibraryTestCase):
self.url = reverse("cms.djangoapps.contentstore:v1:libraries")
# Create a collection to migrate this library to
collection_key = "test-collection"
authoring_api.create_collection(
content_api.create_collection(
learning_package_id=learning_package.id,
key=collection_key,
title="Test Collection",

View File

@@ -13,7 +13,7 @@ from openedx_events.content_authoring.signals import (
XBLOCK_UPDATED,
)
from openedx_events.tests.utils import OpenEdxEventsTestMixin
from openedx_tagging.core.tagging.models import Tag
from openedx_tagging.models import Tag
from organizations.models import Organization
from xmodule.modulestore.django import contentstore, modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, upload_file_to_course, ImmediateOnCommitMixin

View File

@@ -11,8 +11,8 @@ from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.locator import (
LibraryLocatorV2, LibraryUsageLocatorV2, LibraryContainerLocator
)
from openedx_learning.api.authoring import get_draft_version, get_all_drafts
from openedx_learning.api.authoring_models import (
from openedx_content.api import get_draft_version, get_all_drafts
from openedx_content.models_api import (
PublishableEntityVersion, PublishableEntity, DraftChangeLogRecord
)
from xblock.plugin import PluginMissingError

View File

@@ -5,7 +5,7 @@ from __future__ import annotations
from celery.result import AsyncResult
from opaque_keys.edx.locator import LibraryLocatorV2
from openedx_learning.api.authoring import get_collection
from openedx_content.api import get_collection
from openedx.core.types.user import AuthUser
from openedx.core.djangoapps.content_libraries.api import get_library

View File

@@ -11,7 +11,7 @@ from opaque_keys.edx.django.models import (
LearningContextKeyField,
UsageKeyField,
)
from openedx_learning.api.authoring_models import (
from openedx_content.models_api import (
Collection,
DraftChangeLog,
DraftChangeLogRecord,

View File

@@ -5,7 +5,7 @@ Serializers for the Course to Library Import API.
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import LearningContextKey
from opaque_keys.edx.locator import LibraryLocatorV2
from openedx_learning.api.authoring_models import Collection
from openedx_content.models_api import Collection
from rest_framework import serializers
from user_tasks.models import UserTaskStatus
from user_tasks.serializers import StatusSerializer

View File

@@ -30,8 +30,8 @@ from opaque_keys.edx.locator import (
LibraryLocatorV2,
LibraryUsageLocatorV2,
)
from openedx_learning.api import authoring as authoring_api
from openedx_learning.api.authoring_models import (
from openedx_content import api as content_api
from openedx_content.models_api import (
Collection,
Component,
ComponentType,
@@ -295,8 +295,8 @@ def _import_assets(migration: models.ModulestoreMigration) -> dict[str, int]:
continue
filename = os.path.basename(old_path)
media_type_str = mimetypes.guess_type(filename)[0] or "application/octet-stream"
media_type = authoring_api.get_or_create_media_type(media_type_str)
content_by_filename[filename] = authoring_api.get_or_create_file_content(
media_type = content_api.get_or_create_media_type(media_type_str)
content_by_filename[filename] = content_api.get_or_create_file_content(
migration.target_id,
media_type.id,
data=file_data,
@@ -335,7 +335,7 @@ def _import_structure(
tuple[Any, _MigratedNode]:
A tuple containing:
- The first element (`change_log`): the bulk draft change log generated by
`authoring_api.bulk_draft_changes_for`, containing all the imported changes.
`content_api.bulk_draft_changes_for`, containing all the imported changes.
- The second element (`root_migrated_node`): a `_MigratedNode` object that
represents the mapping between the legacy root node and its newly created
Learning Core equivalent.
@@ -345,12 +345,12 @@ def _import_structure(
used_component_keys=set(
LibraryUsageLocatorV2(target_library.key, block_type, block_id) # type: ignore[abstract]
for block_type, block_id
in authoring_api.get_components(migration.target.pk).values_list(
in content_api.get_components(migration.target.pk).values_list(
"component_type__name", "local_key"
)
),
used_container_slugs=set(
authoring_api.get_containers(
content_api.get_containers(
migration.target.pk
).values_list("publishable_entity__key", flat=True)
),
@@ -369,7 +369,7 @@ def _import_structure(
created_by=status.user_id,
created_at=datetime.now(timezone.utc),
)
with authoring_api.bulk_draft_changes_for(migration.target.id) as change_log:
with content_api.bulk_draft_changes_for(migration.target.id) as change_log:
root_migrated_node = _migrate_node(
context=migration_context,
source_node=root_node,
@@ -407,7 +407,7 @@ def _populate_collection(user_id: int, migration: models.ModulestoreMigration) -
).values_list('target_id', flat=True)
)
if block_target_pks:
authoring_api.add_to_collection(
content_api.add_to_collection(
learning_package_id=migration.target.pk,
key=migration.target_collection.key,
entities_qset=PublishableEntity.objects.filter(id__in=block_target_pks),
@@ -693,7 +693,7 @@ def bulk_migrate_from_modulestore(
if source_data.previous_migration:
if previous_collection_slug := source_data.previous_migration.target_collection_slug:
try:
existing_collection_to_use = authoring_api.get_collection(
existing_collection_to_use = content_api.get_collection(
target_package.id, previous_collection_slug
)
except Collection.DoesNotExist:
@@ -886,11 +886,11 @@ def _migrate_container(
version_num=container.draft_version_num,
), None
container_publishable_entity_version = authoring_api.create_next_container_version(
container_publishable_entity_version = content_api.create_next_container_version(
container.container_pk,
title=title,
entity_rows=[
authoring_api.ContainerEntityRow(entity_pk=child.entity_id, version_pk=None)
content_api.ContainerEntityRow(entity_pk=child.entity_id, version_pk=None)
for child in children
],
created=context.created_at,
@@ -924,7 +924,7 @@ def _migrate_component(
(We assume that the destination is a library rather than some other future kind of learning
package, but let's keep than an internal assumption.)
"""
component_type = authoring_api.get_or_create_component_type("xblock.v1", source_key.block_type)
component_type = content_api.get_or_create_component_type("xblock.v1", source_key.block_type)
target_key = _get_distinct_target_usage_key(
context,
@@ -934,7 +934,7 @@ def _migrate_component(
)
try:
component = authoring_api.get_components(context.target_package_id).get(
component = content_api.get_components(context.target_package_id).get(
component_type=component_type,
local_key=target_key.block_id,
)
@@ -954,7 +954,7 @@ def _migrate_component(
except PluginMissingError as e:
log.error(f"Block type not supported in {context.target_library_key}: {e}")
return None, f"Invalid block type: {e}"
component = authoring_api.create_component(
component = content_api.create_component(
context.target_package_id,
component_type=component_type,
local_key=target_key.block_id,
@@ -974,7 +974,7 @@ def _migrate_component(
if filename_no_ext not in olx:
continue
new_path = f"static/{filename}"
authoring_api.create_component_version_content(
content_api.create_component_version_content(
component_version.pk, content_pk, key=new_path
)

View File

@@ -5,7 +5,7 @@ Test cases for the modulestore migrator API.
import pytest
from unittest.mock import patch
from opaque_keys.edx.locator import LibraryLocator, LibraryLocatorV2, CourseLocator
from openedx_learning.api import authoring as authoring_api
from openedx_content import api as content_api
from organizations.tests.factories import OrganizationFactory
from cms.djangoapps.modulestore_migrator import api
@@ -224,7 +224,7 @@ class TestModulestoreMigratorAPI(ModuleStoreTestCase):
user = UserFactory()
collection_key = "test-collection"
authoring_api.create_collection(
content_api.create_collection(
learning_package_id=self.learning_package.id,
key=collection_key,
title="Test Collection",
@@ -479,19 +479,19 @@ class TestModulestoreMigratorAPI(ModuleStoreTestCase):
# Lib 1 has Collection A and Collection B
# Lib 2 has Collection C
authoring_api.create_collection(
content_api.create_collection(
learning_package_id=self.learning_package.id,
key="test-collection-1a",
title="Test Collection A in Lib 1",
created_by=user.id,
)
authoring_api.create_collection(
content_api.create_collection(
learning_package_id=self.learning_package.id,
key="test-collection-1b",
title="Test Collection B in Lib 1",
created_by=user.id,
)
authoring_api.create_collection(
content_api.create_collection(
learning_package_id=self.learning_package_2.id,
key="test-collection-2c",
title="Test Collection C in Lib 2",

View File

@@ -9,8 +9,8 @@ from django.utils import timezone
from lxml import etree
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import LibraryLocator, LibraryLocatorV2
from openedx_learning.api import authoring as authoring_api
from openedx_learning.api.authoring_models import Collection, PublishableEntityVersion
from openedx_content import api as content_api
from openedx_content.models_api import Collection, PublishableEntityVersion
from organizations.tests.factories import OrganizationFactory
from user_tasks.models import UserTaskArtifact
from user_tasks.tasks import UserTaskStatus
@@ -404,8 +404,8 @@ class TestMigrateFromModulestore(ModuleStoreTestCase):
source_key = self.course.id.make_usage_key("problem", "test_problem_with_image")
olx = '<problem display_name="Test Problem"><p>See image: test_image.png</p></problem>'
media_type = authoring_api.get_or_create_media_type("image/png")
test_content = authoring_api.get_or_create_file_content(
media_type = content_api.get_or_create_media_type("image/png")
test_content = content_api.get_or_create_file_content(
self.learning_package.id,
media_type.id,
data=b"fake_image_data",
@@ -637,14 +637,14 @@ class TestMigrateFromModulestore(ModuleStoreTestCase):
)
olx = '<problem display_name="Test Problem"><p>See image: referenced.png</p></problem>'
media_type = authoring_api.get_or_create_media_type("image/png")
referenced_content = authoring_api.get_or_create_file_content(
media_type = content_api.get_or_create_media_type("image/png")
referenced_content = content_api.get_or_create_file_content(
self.learning_package.id,
media_type.id,
data=b"referenced_image_data",
created=timezone.now(),
)
unreferenced_content = authoring_api.get_or_create_file_content(
unreferenced_content = content_api.get_or_create_file_content(
self.learning_package.id,
media_type.id,
data=b"unreferenced_image_data",
@@ -711,32 +711,32 @@ class TestMigrateFromModulestore(ModuleStoreTestCase):
"""
source_key = self.course.id.make_usage_key("vertical", "test_vertical")
child_component_1 = authoring_api.create_component(
child_component_1 = content_api.create_component(
self.learning_package.id,
component_type=authoring_api.get_or_create_component_type(
component_type=content_api.get_or_create_component_type(
"xblock.v1", "problem"
),
local_key="child_problem_1",
created=timezone.now(),
created_by=self.user.id,
)
child_version_1 = authoring_api.create_next_component_version(
child_version_1 = content_api.create_next_component_version(
child_component_1.pk,
content_to_replace={},
created=timezone.now(),
created_by=self.user.id,
)
child_component_2 = authoring_api.create_component(
child_component_2 = content_api.create_component(
self.learning_package.id,
component_type=authoring_api.get_or_create_component_type(
component_type=content_api.get_or_create_component_type(
"xblock.v1", "html"
),
local_key="child_html_1",
created=timezone.now(),
created_by=self.user.id,
)
child_version_2 = authoring_api.create_next_component_version(
child_version_2 = content_api.create_next_component_version(
child_component_2.pk,
content_to_replace={},
created=timezone.now(),
@@ -801,7 +801,7 @@ class TestMigrateFromModulestore(ModuleStoreTestCase):
container_version = result.containerversion
self.assertEqual(container_version.title, f"Test {block_type.title()}")
# The container is published
self.assertFalse(authoring_api.contains_unpublished_changes(container_version.container.pk))
self.assertFalse(content_api.contains_unpublished_changes(container_version.container.pk))
def test_migrate_container_same_title(self):
"""
@@ -899,16 +899,16 @@ class TestMigrateFromModulestore(ModuleStoreTestCase):
context = self._make_migration_context(repeat_handling_strategy=RepeatHandlingStrategy.Skip)
children = []
for i in range(3):
child_component = authoring_api.create_component(
child_component = content_api.create_component(
self.learning_package.id,
component_type=authoring_api.get_or_create_component_type(
component_type=content_api.get_or_create_component_type(
"xblock.v1", "problem"
),
local_key=f"child_problem_{i}",
created=timezone.now(),
created_by=self.user.id,
)
child_version = authoring_api.create_next_component_version(
child_version = content_api.create_next_component_version(
child_component.pk,
content_to_replace={},
created=timezone.now(),
@@ -939,48 +939,48 @@ class TestMigrateFromModulestore(ModuleStoreTestCase):
"""
source_key = self.course.id.make_usage_key("vertical", "mixed_vertical")
problem_component = authoring_api.create_component(
problem_component = content_api.create_component(
self.learning_package.id,
component_type=authoring_api.get_or_create_component_type(
component_type=content_api.get_or_create_component_type(
"xblock.v1", "problem"
),
local_key="mixed_problem",
created=timezone.now(),
created_by=self.user.id,
)
problem_version = authoring_api.create_next_component_version(
problem_version = content_api.create_next_component_version(
problem_component.pk,
content_to_replace={},
created=timezone.now(),
created_by=self.user.id,
)
html_component = authoring_api.create_component(
html_component = content_api.create_component(
self.learning_package.id,
component_type=authoring_api.get_or_create_component_type(
component_type=content_api.get_or_create_component_type(
"xblock.v1", "html"
),
local_key="mixed_html",
created=timezone.now(),
created_by=self.user.id,
)
html_version = authoring_api.create_next_component_version(
html_version = content_api.create_next_component_version(
html_component.pk,
content_to_replace={},
created=timezone.now(),
created_by=self.user.id,
)
video_component = authoring_api.create_component(
video_component = content_api.create_component(
self.learning_package.id,
component_type=authoring_api.get_or_create_component_type(
component_type=content_api.get_or_create_component_type(
"xblock.v1", "video"
),
local_key="mixed_video",
created=timezone.now(),
created_by=self.user.id,
)
video_version = authoring_api.create_next_component_version(
video_version = content_api.create_next_component_version(
video_component.pk,
content_to_replace={},
created=timezone.now(),

View File

@@ -45,7 +45,7 @@ from corsheaders.defaults import default_headers as corsheaders_default_headers
from datetime import timedelta
from django.utils.translation import gettext_lazy as _
from openedx_learning.api.django import openedx_learning_apps_to_install
from openedx_content.settings_api import openedx_content_backcompat_apps_to_install
from openedx.envs.common import * # pylint: disable=wildcard-import
@@ -849,7 +849,7 @@ INSTALLED_APPS = [
'drf_yasg',
# Tagging
'openedx_tagging.core.tagging.apps.TaggingConfig',
'openedx_tagging',
'openedx.core.djangoapps.content_tagging',
# Search
@@ -898,7 +898,9 @@ INSTALLED_APPS = [
'openedx_events',
*openedx_learning_apps_to_install(),
# Core apps that power libraries
"openedx_content",
*openedx_content_backcompat_apps_to_install(),
]
### Apps only installed in some instances

View File

@@ -818,4 +818,3 @@ ZENDESK_GROUP_ID_MAPPING:
ZENDESK_OAUTH_ACCESS_TOKEN: test_zendesk_access
ZENDESK_URL: https://zendesk.com
ZENDESK_USER: daemon@example.com