From a983cc93b05b30daa1a5fd0921602a67117a5487 Mon Sep 17 00:00:00 2001 From: Laurent Lasudry Date: Tue, 10 Sep 2024 09:50:17 +0200 Subject: [PATCH] Add temporary debug annotation to verify section hash updates This refs WEB-3995 --- CHANGES.rst | 3 ++- src/imio/smartweb/core/contents/sections/views.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 966c9345..6d3ad586 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,8 @@ Changelog 1.2.69 (unreleased) ------------------- -- Nothing changed yet. +- WEB-3995 : Add temporary debug annotation to verify section hash updates + [laulaz, remdub] 1.2.68 (2024-09-09) diff --git a/src/imio/smartweb/core/contents/sections/views.py b/src/imio/smartweb/core/contents/sections/views.py index 5401ea92..81410a86 100644 --- a/src/imio/smartweb/core/contents/sections/views.py +++ b/src/imio/smartweb/core/contents/sections/views.py @@ -2,6 +2,7 @@ from Acquisition import aq_inner from imio.smartweb.common.utils import get_vocabulary +from imio.smartweb.common.utils import is_log_active from imio.smartweb.common.utils import translate_vocabulary_term from imio.smartweb.core.utils import hash_md5 from imio.smartweb.core.utils import reindexParent @@ -161,3 +162,8 @@ def refresh_modification_date(self): alsoProvides(self.request, IDisableCSRFProtection) modified(self.context) annotations[SECTION_ITEMS_HASH_KEY] = new_hash + if is_log_active(): + if "JSONS" in annotations: + annotations["JSONS"].append(self.json_data) + else: + annotations["JSONS"] = [self.json_data]