From c0a4e6b480e66b95023635fea312f7a968cf0d98 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Fri, 8 Jul 2016 02:10:26 -0400 Subject: [PATCH] Pass self to HookMixin hooks --- realms/lib/hook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/realms/lib/hook.py b/realms/lib/hook.py index bf6a00e..61d2885 100644 --- a/realms/lib/hook.py +++ b/realms/lib/hook.py @@ -7,7 +7,7 @@ def hook_func(name, fn): @wraps(fn) def wrapper(self, *args, **kwargs): for hook, a, kw in self.__class__._pre_hooks.get(name) or []: - hook(*args, **kwargs) + hook(self, *args, **kwargs) rv = fn(self, *args, **kwargs) @@ -15,7 +15,7 @@ def hook_func(name, fn): kwargs.update(dict(rv=rv)) for hook, a, kw in self.__class__._post_hooks.get(name) or []: - hook(*args, **kwargs) + hook(self, *args, **kwargs) return rv return wrapper