Skip to content

Commit

Permalink
ZO-4683: Use publication status
Browse files Browse the repository at this point in the history
  • Loading branch information
louika committed Feb 19, 2024
1 parent 3f47686 commit 73c4dad
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions core/src/zeit/speech/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,14 @@ def _article(self, speech: IAudio) -> IArticle:

def _assert_article_unchanged(self, speech: IAudio) -> IArticle:
article = self._article(speech)
last_modified = zeit.cms.workflow.interfaces.IModified(article).date_last_modified
last_published = zeit.cms.workflow.interfaces.IPublishInfo(article).date_last_published
if last_modified > last_published:
raise AudioReferenceError(
'%s was modified after publish. Skipped adding reference %s.',
article,
speech,
)
return article
pub_status = zeit.cms.workflow.interfaces.IPublicationStatus(article).published
if pub_status == 'published':
return article
raise AudioReferenceError(
'%s was modified after publish. Skipped adding reference %s.',
article,
speech,
)

def _remove_reference_from_article(self, speech: IAudio):
article = self._article(speech)
Expand Down

0 comments on commit 73c4dad

Please sign in to comment.