Module: check_mk
Branch: master
Commit: 3088b4e3777f25b4234943408304bea0c75e146b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3088b4e3777f25…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 3 12:00:17 2018 +0200
6319 FIX Fixed wrong changelog entry when moving folders
The source folder path did not show up correctly in the WATO changes entry
after moving a folder
Change-Id: Ibf8cbc4ec660c91057909c436b6319c2673aa2df
---
.werks/6319 | 12 ++++++++++++
web/htdocs/watolib.py | 4 +++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/6319 b/.werks/6319
new file mode 100644
index 0000000..5a5707f
--- /dev/null
+++ b/.werks/6319
@@ -0,0 +1,12 @@
+Title: Fixed wrong changelog entry when moving folders
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1530611952
+
+The source folder path did not show up correctly in the WATO changes entry
+after moving a folder
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index e3f1493..6c7bbcf 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -2214,6 +2214,8 @@ class CREFolder(BaseFolder):
if os.path.exists(target_folder.filesystem_path() + "/" +
subfolder.name()):
raise MKUserError(None, _("Cannot move folder: A folder with this name
already exists in the target folder."))
+ original_alias_path = subfolder.alias_path()
+
# 2. Actual modification
affected_sites = subfolder.all_site_ids()
old_filesystem_path = subfolder.filesystem_path()
@@ -2225,7 +2227,7 @@ class CREFolder(BaseFolder):
Folder.invalidate_caches()
affected_sites = list(set(affected_sites + subfolder.all_site_ids()))
add_change("move-folder",
- _("Moved folder %s to %s") % (subfolder.alias_path(),
target_folder.alias_path()),
+ _("Moved folder %s to %s") % (original_alias_path,
target_folder.alias_path()),
obj=subfolder,
sites=affected_sites)
need_sidebar_reload()