diff --git a/wagtail/actions/publish_revision.py b/wagtail/actions/publish_revision.py index 79c07df7d5..5d27f738ca 100644 --- a/wagtail/actions/publish_revision.py +++ b/wagtail/actions/publish_revision.py @@ -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)