Module: check_mk
Branch: master
Commit: bb1cf694984c4c93f16e9f91a0c6c03af3ba81ca
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bb1cf694984c4c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 27 09:10:09 2016 +0200
backup/target deletion: Fixed GUI styling
---
web/htdocs/backup.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/backup.py b/web/htdocs/backup.py
index c9003ee..9a96e12 100644
--- a/web/htdocs/backup.py
+++ b/web/htdocs/backup.py
@@ -1090,8 +1090,13 @@ class PageBackupTargets(object):
self._verify_not_used(target)
- if html.confirm(_("Do you really want to delete this target?"),
- add_header=self.title()):
+ confirm = html.confirm(_("Do you really want to delete this
target?"),
+ add_header=self.title())
+
+ if confirm == False:
+ return False
+
+ elif confirm:
targets.remove(target)
targets.save()
return None, _("The target has been deleted.")
@@ -1651,8 +1656,13 @@ class PageBackupRestore(object):
if backup_ident not in self._target.backups():
raise MKUserError(None, _("This backup does not exist."))
- if html.confirm(_("Do you really want to delete this backup?"),
- add_header=self.title(), method="GET"):
+ confirm = html.confirm(_("Do you really want to delete this backup?"),
+ add_header=self.title(), method="GET")
+
+ if confirm == False:
+ return False
+
+ elif confirm:
html.check_transaction() # invalidate transid
self._target.remove_backup(backup_ident)
return None, _("The backup has been deleted.")