Skip to content

Commit

Permalink
fix: exclude deleted drafts while publishing
Browse files Browse the repository at this point in the history
Exclude draft entities with `null` version while publishing.
  • Loading branch information
navinkarkera committed Aug 13, 2024
1 parent 835c9a1 commit 0d13648
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openedx_learning/apps/authoring/publishing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ def get_all_drafts(learning_package_id: int, /) -> QuerySet[Draft]:

def get_entities_with_unpublished_changes(learning_package_id: int, /) -> QuerySet[PublishableEntity]:
return PublishableEntity.objects \
.filter(learning_package_id=learning_package_id) \
.exclude(draft__version=F('published__version'))
.filter(
learning_package_id=learning_package_id,
draft__version__isnull=False,
).exclude(draft__version=F('published__version'))


def get_entities_with_unpublished_deletes(learning_package_id: int, /) -> QuerySet[PublishableEntity]:
Expand Down

0 comments on commit 0d13648

Please sign in to comment.