From 0dfda6248a00889661085577093a7684aa3ee5cf Mon Sep 17 00:00:00 2001 From: Pierre Narcisi Date: Thu, 28 Sep 2023 13:36:10 +0200 Subject: [PATCH] fix(mapping) fix deletion of mapped field --- backend/gn_module_import/routes/mappings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/gn_module_import/routes/mappings.py b/backend/gn_module_import/routes/mappings.py index 86135057..266e237c 100644 --- a/backend/gn_module_import/routes/mappings.py +++ b/backend/gn_module_import/routes/mappings.py @@ -120,6 +120,10 @@ def update_mapping(mappingtype, mapping, scope): raise BadRequest(*e.args) if mappingtype == "FIELD": mapping.values.update(request.json) + keys = list(mapping.values.keys()) + for k in keys: + if k not in request.json: + mapping.values.pop(k) elif mappingtype == "CONTENT": for key, value in request.json.items(): if key not in mapping.values: