Module: check_mk
Branch: master
Commit: 9dd59ba7d578650c0fdc4d60ee6150d4048e0be9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9dd59ba7d57865…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 29 18:29:49 2011 +0200
Multisite: avoid duplicate hook registration
---
web/htdocs/views.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index c5a5062..4885702 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2261,8 +2261,9 @@ def page_message_and_forward(message, default_url,
addhtml=""):
def register_hook(hook, func):
if not hook in view_hooks:
- view_hooks[hook] = [func]
- else:
+ view_hooks[hook] = []
+
+ if func not in view_hooks[hook]
view_hooks[hook].append(func)
def execute_hooks(hook):