From d4194194879b11c8ae0c25163c9175ea53cb89d7 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 27 Sep 2018 02:20:25 +0200 Subject: [PATCH] Fix for if statements --- platypush/procedure/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platypush/procedure/__init__.py b/platypush/procedure/__init__.py index 002efd8a..45a83874 100644 --- a/platypush/procedure/__init__.py +++ b/platypush/procedure/__init__.py @@ -95,10 +95,10 @@ class Procedure(object): conf['else_branch'] = request_config[key] if_config.put(conf) - if not if_config.empty(): - reqs.append(IfProcedure.build(**(if_config.get()))) - if key == 'else': - continue + if not if_config.empty(): + reqs.append(IfProcedure.build(**(if_config.get()))) + if key == 'else': + continue request_config['origin'] = Config.get('device_id') request_config['id'] = id @@ -108,8 +108,8 @@ class Procedure(object): request = Request.build(request_config) reqs.append(request) - if not if_config.empty(): - reqs.append(IfProcedure.build(**(if_config.get()))) + for pending_if in if_config.queue: + reqs.append(IfProcedure.build(**pending_if)) return procedure_class(name=name, _async=_async, requests=reqs, args=args, backend=backend, **kwargs)