0001-workflow-stop-on-delete-action-52927.patch
wcs/wf/remove.py | ||
---|---|---|
16 | 16 | |
17 | 17 |
from quixote import get_publisher, get_request, get_response, get_session |
18 | 18 | |
19 |
from wcs.workflows import WorkflowStatusItem, register_item_class |
|
19 |
from wcs.workflows import AbortActionException, WorkflowStatusItem, register_item_class
|
|
20 | 20 | |
21 | 21 |
from ..qommon import N_, _ |
22 | 22 | |
... | ... | |
30 | 30 |
formdata.remove_self() |
31 | 31 |
if get_request() and get_response().filter.get('in_backoffice'): |
32 | 32 |
get_session().message = ('info', _('The form has been deleted.')) |
33 |
return '..' |
|
34 |
return get_publisher().get_frontoffice_url() |
|
33 |
url = '..' |
|
34 |
else: |
|
35 |
url = get_publisher().get_frontoffice_url() |
|
36 |
raise AbortActionException(url=url) |
|
35 | 37 | |
36 | 38 | |
37 | 39 |
register_item_class(RemoveWorkflowStatusItem) |
wcs/workflows.py | ||
---|---|---|
78 | 78 |
continue |
79 | 79 |
try: |
80 | 80 |
url = item.perform(formdata) or url |
81 |
except AbortActionException: |
|
81 |
except AbortActionException as e: |
|
82 |
url = e.url or url |
|
82 | 83 |
break |
83 | 84 |
if formdata.status != old_status: |
84 | 85 |
break |
... | ... | |
109 | 110 | |
110 | 111 | |
111 | 112 |
class AbortActionException(Exception): |
112 |
pass |
|
113 |
def __init__(self, url=None): |
|
114 |
self.url = url |
|
113 | 115 | |
114 | 116 | |
115 | 117 |
class AttachmentSubstitutionProxy: |
116 |
- |