diff --git a/openedx_learning/core/publishing/api.py b/openedx_learning/core/publishing/api.py index 624425d9..ab4099ad 100644 --- a/openedx_learning/core/publishing/api.py +++ b/openedx_learning/core/publishing/api.py @@ -95,7 +95,7 @@ def create_publishable_entity_version( ) Draft.objects.update_or_create( entity_id=entity_id, - defaults=dict(version=version), + defaults={"version": version}, ) return version @@ -193,10 +193,10 @@ def get_draft_version(publishable_entity_id: int) -> PublishableEntityVersion | except Draft.DoesNotExist: # No draft was ever created. return None - + # draft.version could be None if it was set that way by set_draft_version. # Setting the Draft.version to None is how we show that we've "deleted" the - # content in Studio. + # content in Studio. return draft.version diff --git a/openedx_learning/lib/admin_utils.py b/openedx_learning/lib/admin_utils.py index b1662d25..cffd2f80 100644 --- a/openedx_learning/lib/admin_utils.py +++ b/openedx_learning/lib/admin_utils.py @@ -5,7 +5,6 @@ from django.db.models.fields.reverse_related import OneToOneRel from django.urls import reverse, NoReverseMatch from django.utils.html import format_html, format_html_join -from django.utils.safestring import mark_safe class ReadOnlyModelAdmin(admin.ModelAdmin): diff --git a/tests/openedx_learning/core/publishing/test_api.py b/tests/openedx_learning/core/publishing/test_api.py index 7f880ba1..b7db58eb 100644 --- a/tests/openedx_learning/core/publishing/test_api.py +++ b/tests/openedx_learning/core/publishing/test_api.py @@ -81,6 +81,9 @@ def test_already_exists(self) -> None: class DraftTestCase(TestCase): + """ + Test basic operations with Drafts. + """ def test_draft_lifecycle(self): """