Module: check_mk
Branch: master
Commit: 89a8c819663276d73a6f40047fdfe140419c13df
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=89a8c819663276…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 16 14:00:30 2016 +0100
#3216 FIX Fixed exception when trying to edit an already deleted user
---
.werks/3216 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/.werks/3216 b/.werks/3216
new file mode 100644
index 0000000..9a28a60
--- /dev/null
+++ b/.werks/3216
@@ -0,0 +1,10 @@
+Title: Fixed exception when trying to edit an already deleted user
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1455627596
+
+
diff --git a/ChangeLog b/ChangeLog
index dbd56fc..8f03b1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
* 3062 FIX: Git integration: Fixed not adding files in WATO folders to git control
* 3203 FIX: Distributed WATO: Fixed exception in remote host service discovery...
* 3215 FIX: WATO git ignore files are now updated on each commit
+ * 3216 FIX: Fixed exception when trying to edit an already deleted user
Event Console:
* 3058 FIX: Event Console is now allowing non loadable MIB modules on startup...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 8c05a28..cb51ddb 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8038,6 +8038,9 @@ def mode_notification_rule(phase, profilemode):
if userid:
users = userdb.load_users(lock = phase == 'action')
+ if userid not in users:
+ raise MKUserError(None, _("The user you are trying to edit "
+ "notification rules for does not
exist."))
user = users[userid]
rules = user.setdefault("notification_rules", [])
else:
@@ -10101,6 +10104,8 @@ def mode_edit_user(phase):
users[id] = new_user
else:
id = html.get_unicode_input("edit").strip()
+ if id not in users:
+ raise MKUserError(None, _("The user you are trying to edit does not
exist."))
new_user = users[id]
# Full name