Skip to content

Commit

Permalink
fixup!: pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ormsbee committed Oct 23, 2023
1 parent 6c86503 commit cb00d1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions openedx_learning/core/publishing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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


Expand Down
1 change: 0 additions & 1 deletion openedx_learning/lib/admin_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 3 additions & 0 deletions tests/openedx_learning/core/publishing/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def test_already_exists(self) -> None:


class DraftTestCase(TestCase):
"""
Test basic operations with Drafts.
"""

def test_draft_lifecycle(self):
"""
Expand Down

0 comments on commit cb00d1d

Please sign in to comment.