Module: check_mk
Branch: master
Commit: 2f414b9a61faa8f9184d059b21c36ae49ed034b2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2f414b9a61faa8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 7 08:31:27 2014 +0200
Fixed problem saving/loading favorites after yesterdays changes
---
web/htdocs/config.py | 7 +++++++
web/plugins/views/commands.py | 11 ++---------
web/plugins/visuals/filters.py | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 1e99404..00a0801 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -372,6 +372,13 @@ def get_role_permissions():
role_permissions[role_id].append(perm['name'])
return role_permissions
+
+def load_stars():
+ return set(config.load_user_file("favorites", []))
+
+def save_stars(stars):
+ config.save_user_file("favorites", list(stars))
+
# Helper functions
def load_user_file(name, deflt, lock = False):
path = user_confdir + "/" + name + ".mk"
diff --git a/web/plugins/views/commands.py b/web/plugins/views/commands.py
index 3439e96..a2b1ef2 100644
--- a/web/plugins/views/commands.py
+++ b/web/plugins/views/commands.py
@@ -546,13 +546,6 @@ multisite_commands.append({
# | |
# '----------------------------------------------------------------------'
-def load_stars():
- return set(config.load_user_file("favorites", []))
-
-def save_stars(stars):
- config.save_user_file("favorites", list(stars))
-
-
def command_star(cmdtag, spec, row):
if html.var("_star") or html.var("_unstar"):
star = html.var("_star") and 1 or 0
@@ -565,12 +558,12 @@ def command_star(cmdtag, spec, row):
def command_executor_star(command, site):
foo, star, spec = command.split(";", 2)
- stars = load_stars()
+ stars = config.load_stars()
if star == "0" and spec in stars:
stars.remove(spec)
elif star == "1":
stars.add(spec)
- save_stars(stars)
+ config.save_stars(stars)
config.declare_permission("action.star",
_("Use favorites"),
diff --git a/web/plugins/visuals/filters.py b/web/plugins/visuals/filters.py
index a80f9ae..2babf82 100644
--- a/web/plugins/visuals/filters.py
+++ b/web/plugins/visuals/filters.py
@@ -908,7 +908,7 @@ class FilterStarred(FilterTristate):
else:
aand, oor, eq = "Or", "And", "!="
- stars = load_stars()
+ stars = config.load_stars()
filters = ""
count = 0
if self.what == "host":