Module: check_mk
Branch: master
Commit: 04b537e9d01d3540dd8e831e82c1ac840a7e9366
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=04b537e9d01d35…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Aug 23 15:34:25 2011 +0200
View editor: warn if no column has been added
---
.bugs/49 | 10 +++++++---
web/htdocs/views.py | 5 ++++-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/.bugs/49 b/.bugs/49
index ab4e084..3f75c85 100644
--- a/.bugs/49
+++ b/.bugs/49
@@ -1,11 +1,15 @@
Title: View editor: Warnung, wenn keine Spalten ausgewählt
Component: multisite
+State: done
+Class: nastiness
+Date: 2010-12-21 21:31:11
Benefit: 1
-State: open
Cost: 1
-Date: 2010-12-21 21:31:11
-Class: nastiness
+Fun: 0
Wenn der Benutzer keine einzige Spalte ausgewält hat, darf
er die View nicht speichern können. Es gab schon User, die sich
gewundert haben, dass sie nix sehen.
+
+2011-08-23 15:33:19: changed state open -> done
+Jetzt gibts eine Fehlermeldung, wenn man keine Spalte hat.
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 74be45a..1c4f392 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -496,7 +496,7 @@ def page_edit_view():
if oldname and oldname != view["name"] and (html.req.user,
oldname) in html.multisite_views:
del html.multisite_views[(html.req.user, oldname)]
save_views(html.req.user)
- return page_message_and_forward("Your view has been saved.",
"edit_views.py",
+ return page_message_and_forward(_("Your view has been saved."),
"edit_views.py",
"<script
type='text/javascript'>top.frames[0].location.reload();</script>\n")
except MKUserError, e:
@@ -965,6 +965,9 @@ def create_view():
else:
painternames.append((pname, viewname, tooltip))
+ if len(painternames) == 0:
+ raise MKUserError("col_1", _("Please add at least one column to
your view."))
+
return {
"name" : name,
"owner" : html.req.user,