diff --git a/platypush/event/hook.py b/platypush/event/hook.py index ed04ab43..82d252ee 100644 --- a/platypush/event/hook.py +++ b/platypush/event/hook.py @@ -69,7 +69,8 @@ class EventAction(Request): """ Event hook action class. It is a special type of runnable request whose fields can be configured later depending on the event context """ - def __init__(self, target=Config.get('device_id'), action=None, **args): + def __init__(self, target=None, action=None, **args): + if target is None: target=Config.get('device_id') super().__init__(target=target, action=action, **args) diff --git a/platypush/event/processor/__init__.py b/platypush/event/processor/__init__.py index f2254c9e..06ce12e6 100644 --- a/platypush/event/processor/__init__.py +++ b/platypush/event/processor/__init__.py @@ -10,12 +10,14 @@ class EventProcessor(object): """ Event processor class. Checks an event against the configured rules and executes any matching event hooks """ - def __init__(self, hooks=Config.get_event_hooks(), **kwargs): + def __init__(self, hooks=None, **kwargs): """ Params: hooks -- List of event hooks (default: any entry in the config named as event.hook. """ + if hooks is None: hooks = Config.get_event_hooks() + self.hooks = [] for (name, hook) in hooks.items(): h = EventHook.build(name=name, hook=hook)