Check workflow cancel before getting workflow

pull/12548/head
Jake Howard 2024-10-04 10:49:55 +01:00 zatwierdzone przez Matt Westcott
rodzic b0c90d4be2
commit 37567dfe18
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -94,9 +94,8 @@ class PublishRevisionAction:
)
if isinstance(self.object, WorkflowMixin):
workflow_state = self.object.current_workflow_state
if workflow_state and getattr(
settings, "WAGTAIL_WORKFLOW_CANCEL_ON_PUBLISH", True
if getattr(settings, "WAGTAIL_WORKFLOW_CANCEL_ON_PUBLISH", True) and (
workflow_state := self.object.current_workflow_state
):
workflow_state.cancel(user=self.user)