diff --git a/wcs/admin/workflows.ptl b/wcs/admin/workflows.ptl
index 1340dd4fc..0adc8de0c 100644
--- a/wcs/admin/workflows.ptl
+++ b/wcs/admin/workflows.ptl
@@ -272,7 +272,8 @@ class WorkflowItemsDir(Directory):
class WorkflowStatusPage(Directory):
_q_exports = ['', 'delete', 'newitem', ('items', 'items_dir'),
- 'update_order', 'edit', 'reassign', 'visibility']
+ 'update_order', 'edit', 'reassign', 'visibility',
+ 'force_endpoint', 'unforce_endpoint']
def __init__(self, workflow, status_id):
self.workflow = workflow
@@ -354,6 +355,10 @@ class WorkflowStatusPage(Directory):
'
'
'- %s
' % _('Change Status Name')
'- %s
' % _('Change Status Visibility')
+ if not self.status.forced_endpoint:
+ '- %s
' % _('Mark the Status as Terminal')
+ else:
+ '- %s
' % _('Unmark the Status as Terminal')
'- %s
' % _('Delete')
'
'
''
@@ -553,6 +558,16 @@ class WorkflowStatusPage(Directory):
'
%s
' % _('Edit Workflow Status Visibility')
form.render()
+ def force_endpoint(self):
+ self.status.forced_endpoint = True
+ self.workflow.store()
+ return redirect('.')
+
+ def unforce_endpoint(self):
+ self.status.forced_endpoint = False
+ self.workflow.store()
+ return redirect('.')
+
class WorkflowStatusDirectory(Directory):
_q_exports = ['']
diff --git a/wcs/workflows.py b/wcs/workflows.py
index 5d81132ce..1c36d4868 100644
--- a/wcs/workflows.py
+++ b/wcs/workflows.py
@@ -133,9 +133,12 @@ class Workflow(StorableObject):
for status in self.possible_status:
waitpoint = False
endpoint = True
- for item in status.items:
- endpoint = item.endpoint and endpoint
- waitpoint = item.waitpoint or waitpoint
+ if status.forced_endpoint:
+ endpoint = True
+ else:
+ for item in status.items:
+ endpoint = item.endpoint and endpoint
+ waitpoint = item.waitpoint or waitpoint
if endpoint or waitpoint:
waitpoint_status.append(status)
return waitpoint_status
@@ -148,6 +151,8 @@ class Workflow(StorableObject):
def get_not_endpoint_status(self):
not_endpoint_status = []
for status in self.possible_status:
+ if status.forced_endpoint:
+ continue
endpoint = True
for item in status.items:
endpoint = item.endpoint and endpoint
@@ -335,6 +340,7 @@ class WorkflowStatus:
name = None
items = None
visibility = None
+ forced_endpoint = False
def __init__(self, name = None):
self.name = name