diff --git a/wagtail/wagtailcore/hooks.py b/wagtail/wagtailcore/hooks.py index b6d13bf11..958675b97 100644 --- a/wagtail/wagtailcore/hooks.py +++ b/wagtail/wagtailcore/hooks.py @@ -25,7 +25,10 @@ def register(hook_name, fn=None): # Pretend to be a decorator if fn is not supplied if fn is None: - return lambda fn: register(hook_name, fn) + def decorator(fn): + register(hook_name, fn) + return fn + return decorator if hook_name not in _hooks: _hooks[hook_name] = []