Skip to content
This repository was archived by the owner on Apr 12, 2018. It is now read-only.

Commit e6d9b4d

Browse files
committed
Fix swf.querysets.WorkflowExecutionQuerySet: make domain and kwargs consistent
1 parent 3daea55 commit e6d9b4d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

swf/querysets/workflow.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from swf.constants import REGISTERED
1111
from swf.querysets.base import BaseQuerySet
12+
from swf.models import Domain
1213
from swf.models.workflow import (WorkflowType, WorkflowExecution,
1314
CHILD_POLICIES)
1415
from swf.utils import datetime_timestamp, past_day, get_subkey
@@ -437,7 +438,7 @@ def to_WorkflowExecution(self, domain, execution_info, **kwargs):
437438
)
438439

439440
return WorkflowExecution(
440-
domain,
441+
Domain(domain),
441442
get_subkey(execution_info, ['execution', 'workflowId']), # workflow_id
442443
run_id=get_subkey(execution_info, ['execution', 'runId']),
443444
workflow_type=workflow_type,
@@ -545,7 +546,6 @@ def filter(self, domain=None,
545546
"""
546547
# As WorkflowTypeQuery has to be built against a specific domain
547548
# name, domain filter is disposable, but not mandatory.
548-
domain = domain or self.domain.name
549549
invalid_kwargs = self._validate_status_parameters(status, kwargs)
550550

551551
if invalid_kwargs:
@@ -560,9 +560,14 @@ def filter(self, domain=None,
560560

561561
start_oldest_date = datetime_timestamp(past_day(oldest_date))
562562
return [self.to_WorkflowExecution(domain, wfe) for wfe in
563-
self._list_items(status,
564-
domain,
565-
start_oldest_date=int(start_oldest_date))]
563+
self._list_items(
564+
status,
565+
self.domain.name,
566+
*args,
567+
start_oldest_date=int(start_oldest_date),
568+
tag=tag,
569+
**kwargs
570+
)]
566571

567572
def _list(self, *args, **kwargs):
568573
return self.list_workflow_executions(*args, **kwargs)

0 commit comments

Comments
 (0)