Add WorkflowExecution.open to clarify code in some places

This commit is contained in:
Jean-Baptiste Barth 2015-11-04 22:25:27 +01:00
commit 9c3996ff58
3 changed files with 8 additions and 4 deletions

View file

@ -243,7 +243,7 @@ class SWFBackend(BaseBackend):
raise SWFValidationException("Invalid token")
# decision task found, but WorflowExecution is CLOSED
wfe = decision_task.workflow_execution
if wfe.execution_status != "OPEN":
if not wfe.open:
raise SWFUnknownResourceFault(
"execution",
"WorkflowExecution=[workflowId={0}, runId={1}]".format(
@ -331,7 +331,7 @@ class SWFBackend(BaseBackend):
raise SWFValidationException("Invalid token")
# activity task found, but WorflowExecution is CLOSED
wfe = activity_task.workflow_execution
if wfe.execution_status != "OPEN":
if not wfe.open:
raise SWFUnknownResourceFault(
"execution",
"WorkflowExecution=[workflowId={0}, runId={1}]".format(