Skip to content

Commit

Permalink
fix: version_num error because pub_ent was not declared
Browse files Browse the repository at this point in the history
  • Loading branch information
ormsbee committed Sep 4, 2024
1 parent 034e570 commit 7daf487
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions openedx_learning/apps/authoring/publishing/model_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def version_num(self, version_num):
"""
Return a specific numbered version model.
"""
pub_ent = self.content_obj.publishable_entity
return self.content_version_model_cls.objects.get(
publishable_entity_version__entity_id=pub_ent.id,
publishable_entity_version__version_num=version_num,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def test_latest_version(self) -> None:
# Grabbing the list of versions for this component
assert list(component.versioning.versions) == [component_version]

# Grab a specific version by number
assert component.versioning.version_num(1) == component_version

def test_last_publish_log(self):
"""
Test last_publish_log versioning property for published Components.
Expand Down

0 comments on commit 7daf487

Please sign in to comment.