Commit 6e3bc165 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

AdHoc: Cancel action is always possible

parent 7449bbdf
Pipeline #7712 passed with stages
in 5 minutes and 26 seconds
......@@ -150,12 +150,15 @@ def _parse_notes(command):
def _parse_actions(command):
if command.getAttr('status') != 'executing':
return [], None
actions_node = command.getTag('actions')
if actions_node is None:
# If there is no <actions/> element,
# the user-agent can use a single-stage dialog or view.
# The action "execute" is equivalent to the action "complete".
return [AdHocAction.COMPLETE], AdHocAction.COMPLETE
return [AdHocAction.CANCEL, AdHocAction.COMPLETE], AdHocAction.COMPLETE
actions = []
for action in actions_node.getChildren():
......@@ -167,6 +170,9 @@ def _parse_actions(command):
if not actions:
raise ValueError('actions element without actions')
# The action "cancel" is always allowed.
default = actions_node.getAttr('execute')
if default is None:
# If the "execute" attribute is absent, it defaults to "next".
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment