Module: check_mk
Branch: master
Commit: e3c8fa17c84375c271855898458c0046499f8dff
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e3c8fa17c84375…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 24 13:36:37 2011 +0200
Remove *new* user sorters also from view sorters
---
web/htdocs/views.py | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 661d90b..d860b01 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2253,11 +2253,12 @@ def sort_url(view, painter):
sorter.remove(this_desc_sorter)
else:
# First click: add this sorter as primary user sorter
- # Maybe the sorter is already in the user sorters, remove it
- if this_asc_sorter in user_sort:
- user_sort.remove(this_asc_sorter)
- if this_desc_sorter in user_sort:
- user_sort.remove(this_desc_sorter)
+ # Maybe the sorter is already in the user sorters or view sorters, remove it
+ for s in [ user_sort, view_sort ]:
+ if this_asc_sorter in s:
+ s.remove(this_asc_sorter)
+ if this_desc_sorter in s:
+ s.remove(this_desc_sorter)
# Now add the sorter as primary user sorter
sorter = group_sort + [this_asc_sorter] + user_sort + view_sort