From 96742284fc1e95f7eabec09fecc852f69fce7cae Mon Sep 17 00:00:00 2001 From: multiflexi Date: Fri, 26 Jul 2024 16:17:47 +0200 Subject: [PATCH] update value desc only if found --- src/core/model/report_item.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core/model/report_item.py b/src/core/model/report_item.py index 3bfdb947..1dd47fd0 100644 --- a/src/core/model/report_item.py +++ b/src/core/model/report_item.py @@ -705,12 +705,13 @@ def update_report_item(cls, id, data, user): data["attribute_value"] = "" attribute.user = user attribute.last_updated = datetime.now() - if attribute.value_description != data["value_description"]: - modified = True - attribute.value_description = data["value_description"] - data["value_description"] = "" - attribute.user = user - attribute.last_updated = datetime.now() + if data.get("value_description", False): + if attribute.value_description != data["value_description"]: + modified = True + attribute.value_description = data["value_description"] + data["value_description"] = "" + attribute.user = user + attribute.last_updated = datetime.now() break if "add" in data: