mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-21 18:09:02 +01:00
Check workflow cancel before getting workflow
This commit is contained in:
parent
b0c90d4be2
commit
37567dfe18
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user