Skip to content

Commit

Permalink
bugfix - empty hook, preseverte the data
Browse files Browse the repository at this point in the history
  • Loading branch information
Signorini committed Jan 25, 2019
1 parent 626f2d0 commit 1d46de9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/services/hooks/hooker.py
Expand Up @@ -13,7 +13,6 @@ def exec(self, rule, obj):
hook = rule.get('hook')
method = rule.get('method')


return getattr(self._register[hook], method)(obj, self._conn)

def rules(self, obj):
Expand Down
6 changes: 4 additions & 2 deletions app/tasks/insert.py
Expand Up @@ -41,8 +41,10 @@ def task_insert(conn, conn_id, task, result, options, lasted=False):
body = MergeAPI(content=content, key_comparer=key).merge(result)

if len(body) > 0:
CHooker = Hooker(options.get('hooks'), conn)
body = CHooker.run(body)
hooks = options.get('hooks')
if hooks:
CHooker = Hooker(hooks, conn)
body = CHooker.run(body)

dataresult = ExternalMaestroData(entity_id=conn_id)\
.put_request(path=options['entity'], body={'body': body})\
Expand Down

0 comments on commit 1d46de9

Please sign in to comment.