src/pyams_content/shared/site/__init__.py
changeset 300 49e8f3cef75a
parent 294 8742c8ac126c
child 353 4839285629d1
--- a/src/pyams_content/shared/site/__init__.py	Tue Nov 28 17:26:34 2017 +0100
+++ b/src/pyams_content/shared/site/__init__.py	Tue Nov 28 17:27:24 2017 +0100
@@ -20,6 +20,7 @@
 from pyams_content.component.theme.interfaces import IThemesTarget
 from pyams_content.features.preview.interfaces import IPreviewTarget
 from pyams_content.features.review.interfaces import IReviewTarget
+from pyams_workflow.interfaces import IWorkflow, IWorkflowVersions, IWorkflowState
 
 # import packages
 from pyams_content.shared.common import SharedContent, WfSharedContent, register_content_type
@@ -44,3 +45,10 @@
     """WOrkflow managed topic class"""
 
     content_class = WfTopic
+
+    def is_deletable(self):
+        workflow = IWorkflow(self)
+        for version in IWorkflowVersions(self).get_versions():
+            if IWorkflowState(version).state != workflow.initial_state:
+                return False
+        return True