Module: check_mk
Branch: master
Commit: d5bbe32fa626217d5482680694045eeed6add9a6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d5bbe32fa62621…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Jan 20 14:39:25 2014 +0100
FIX Multisite view editor not longer throwing a exception when loading views from other
users
---
.werks/122 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/views.py | 25 ++++++++++++++-----------
3 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/.werks/122 b/.werks/122
new file mode 100644
index 0000000..6adb63b
--- /dev/null
+++ b/.werks/122
@@ -0,0 +1,9 @@
+Title: Multisite view editor not longer throwing a exception when loading views from
other users
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390225114
+
+
diff --git a/ChangeLog b/ChangeLog
index d5ac8c7..1c1ce3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -153,6 +153,7 @@
* 0425 FIX: Fix login loop bug in distributed environments with different auth
secrets
* 0117 FIX: Availability button is now visible for users without the right to edit
views
* 0431 FIX: LDAP: Fixed group syncrhonisation when nested group sync is enabled
+ * 0122 FIX: Multisite view editor not longer throwing a exception when loading views
from other users
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index f36b808..3c09495 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -265,8 +265,19 @@ def load_views():
view["owner"] = user
view["name"] = name
- if view['datasource'] in multisite_datasources:
- html.multisite_views[(user, name)] = view
+ if view['datasource'] not in multisite_datasources:
+ continue
+
+
+ # Maybe resolve inherited attributes
+ builtin_view = html.multisite_views.get(('', name))
+ if builtin_view:
+ for attr in view_inherit_attrs:
+ if attr not in view and attr in builtin_view:
+ view[attr] = builtin_view[attr]
+
+ html.multisite_views[(user, name)] = view
+
except SyntaxError, e:
raise MKGeneralException(_("Cannot load views from %s/views.mk:
%s") % (dirpath, e))
@@ -311,15 +322,7 @@ def available_views():
and not config.may(permname):
continue
views[n] = view
-
- # Maybe resolve inherited attributes
- for name, view in views.items():
- builtin_view = html.multisite_views.get(('', name))
- if builtin_view:
- for attr in view_inherit_attrs:
- if attr not in view and attr in builtin_view:
- view[attr] = builtin_view[attr]
-
+
return views
def save_views(us):