Skip to content

Commit 13f66a3

Browse files
committed
DRY
Signed-off-by: Patrick Assuied <[email protected]>
1 parent 23275b7 commit 13f66a3

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,13 @@ async def schedule_new_workflow(
9696
Returns:
9797
The ID of the scheduled workflow instance.
9898
"""
99-
if hasattr(workflow, '_dapr_alternate_name'):
100-
return await self.__obj.schedule_new_orchestration(
101-
workflow.__dict__['_dapr_alternate_name'],
102-
input=input,
103-
instance_id=instance_id,
104-
start_at=start_at,
105-
reuse_id_policy=reuse_id_policy,
106-
)
99+
workflow_name = (
100+
workflow.__dict__['_dapr_alternate_name']
101+
if hasattr(workflow, '_dapr_alternate_name')
102+
else workflow.__name__
103+
)
107104
return await self.__obj.schedule_new_orchestration(
108-
workflow.__name__,
105+
workflow_name,
109106
input=input,
110107
instance_id=instance_id,
111108
start_at=start_at,

0 commit comments

Comments
 (0)