Module: check_mk
Branch: master
Commit: 2181fd3ed9c0ddd8b7341f2e5e47b73a34fc7fa9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2181fd3ed9c0dd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 5 08:32:23 2015 +0100
Convert legacy bookmarks to bookmark list only when user has no other bookmark lists
---
web/plugins/sidebar/shipped.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index fde5d12..d1a4d02 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -1144,9 +1144,15 @@ class BookmarkList(pagetypes.Overridable, pagetypes.Base):
@classmethod
def load_legacy_bookmarks(self):
+ # Don't load the legacy bookmarks when there is already a my_bookmarks list
if self.has_instance((config.user_id, "my_bookmarks")):
return
+ # Also don't load them when the user has at least one bookmark list
+ for user_id, name in self.instances_dict().keys():
+ if user_id == config.user_id:
+ return
+
bookmark_list = {
"title" : u"My Bookmarks",
"public" : False,