Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ def get_version(*file_paths):

VERSION = get_version('../src/openedx_core', '__init__.py')

# Configure Django for autodoc usage
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
django_setup()

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../src'))

# Configure Django for autodoc usage
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
django_setup()

# -- General configuration ------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions src/openedx_content/applets/containers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ def get_descendant_component_entity_ids(container: Container) -> list[int]:
automatically because ``get_entities_in_container`` omits them.
Edge cases:
- A container whose draft was soft-deleted has no children to traverse and
contributes no entity IDs.
- An entity that appears as a child of multiple containers is deduplicated
Expand Down
4 changes: 4 additions & 0 deletions src/openedx_content/applets/publishing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ def get_entity_draft_history(
ordered from most recent to oldest.

Edge cases:

- Never published, no versions: returns an empty queryset.
- Never published, has versions: returns all DraftChangeLogRecords.
- No changes since the last publish: returns an empty queryset.
Expand Down Expand Up @@ -691,6 +692,7 @@ def get_entity_publish_history(
Return all PublishLogRecords for a PublishableEntity, ordered most recent first.

Edge cases:

- Never published: returns an empty queryset.
- Soft-delete published (new_version=None): the record is included with
old_version pointing to the last published version and new_version=None,
Expand Down Expand Up @@ -735,6 +737,7 @@ def get_entity_publish_history_entries(
joins.

Edge cases:

- Each publish group is independent: only the DraftChangeLogRecords that
belong to the requested publish_log_uuid are returned; changes attributed
to other publish groups are excluded.
Expand Down Expand Up @@ -831,6 +834,7 @@ def get_entity_version_contributors(
record whose old_version falls before old_version_num is excluded.

Edge cases:

- If no DraftChangeLogRecords fall in the range, returns an empty queryset.
- Records with changed_by=None (system changes with no associated user) are
always excluded.
Expand Down
3 changes: 3 additions & 0 deletions src/openedx_content/applets/publishing/models/draft_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ class DraftSideEffect(models.Model):

Scenario 1: In the a bulk_draft_changes_for context, we edit C1 so that the
draft version of C1 is now C1.v2. Result:

- a DraftChangeLogRecord is created for C1.v1 -> C1.v2
- a DraftChangeLogRecord is created for U1.v1 -> U1.v1
- a DraftSideEffect is created with cause (C1.v1 -> C1.v2) and effect
Expand All @@ -350,6 +351,7 @@ class DraftSideEffect(models.Model):
draft version of C1 is now C1.v2. In the same context, we edit U1's metadata
so that the draft version of U1 is now U1.v2. U1.v2 still lists C1 as a
child entity. Result:

- a DraftChangeLogRecord is created for C1.v1 -> C1.v2
- a DraftChangeLogRecord is created for U1.v1 -> U1.v2
- a DraftSideEffect is created with cause (C1.v1 -> C1.v2) and effect
Expand All @@ -358,6 +360,7 @@ class DraftSideEffect(models.Model):
Scenario 3: In a bulk_draft_changes_for context, we edit C1 so that the
draft version of C1 is now C1.v2. In the same context, we edit U1's list of
children so that C1 is no longer a child of U1.v2. Result:

- a DraftChangeLogRecord is created for C1.v1 -> C1.v2
- a DraftChangeLogRecord is created for U1.v1 -> U1.v2
- no SideEffect is created, since changing C1 does not have an impact on the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ class PublishableEntity(models.Model):
model instead of storing them in those other models? Two reasons:

* Published things need to have the right identifiers so they can be used
throughout the system, and the UUID is serving the role of ISBN in physical
book publishing.
throughout the system, and the UUID is serving the role of ISBN in physical
book publishing.
* We want to be able to enforce the idea that "entity_ref" is locally unique across
all PublishableEntities within a given LearningPackage. Component and Unit
can't do that without a shared model.
all PublishableEntities within a given LearningPackage. Component and Unit
can't do that without a shared model.

That being said, models that build on PublishableEntity are free to add
their own identifiers if it's useful to do so.
Expand Down