[checkmk-commits] Fixed webapi activate_changes reading "allow_foreign_changes"

Lars Michelsen lm at mathias-kettner.de
Wed Nov 9 11:08:19 CET 2016


  from request object too
Message-ID: <5822f593.OmEhznKOyA5xVacy%lm at mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Module: check_mk
Branch: master
Commit: 4670e24ff0f9a26bd44b639a51b209b1a6cae24c
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4670e24ff0f9a26bd44b639a51b209b1a6cae24c

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Wed Nov  9 09:38:39 2016 +0100

Fixed webapi activate_changes reading "allow_foreign_changes" from request object too

---

 web/plugins/webapi/webapi.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/web/plugins/webapi/webapi.py b/web/plugins/webapi/webapi.py
index 4044184..33c9a4b 100644
--- a/web/plugins/webapi/webapi.py
+++ b/web/plugins/webapi/webapi.py
@@ -292,13 +292,12 @@ api_actions["discover_services"] = {
 
 ###############
 
-# TODO: Recode to new activation code
 def action_activate_changes(request):
     validate_request_keys(request, ["mode", "sites", "allow_foreign_changes", "comment"])
 
     mode = html.var("mode") and html.var("mode") or "dirty"
-    if html.var("allow_foreign_changes"):
-        allow_foreign_changes = bool(int(html.var("allow_foreign_changes")))
+    if request.get("allow_foreign_changes"):
+        allow_foreign_changes = bool(int(request.get("allow_foreign_changes")))
     else:
         allow_foreign_changes = False
 



More information about the checkmk-commits mailing list