From 8c1fb17daca95dbaa960a0fc98f7cbd3830f5a2d Mon Sep 17 00:00:00 2001 From: Mark Brough Date: Wed, 8 Nov 2023 16:46:55 +0100 Subject: [PATCH] Only set status to active if it is currently set to withdrawn --- importers/helpers/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/importers/helpers/__init__.py b/importers/helpers/__init__.py index cbbf0ab..fb041d3 100644 --- a/importers/helpers/__init__.py +++ b/importers/helpers/__init__.py @@ -135,7 +135,8 @@ def update_codelist_item(self, codelist_item, code_dict, namespaces=None): # the status is set manually. This is required in case # a codelist briefly disappears then reappears in the source # data. - codelist_item.set('status', 'active') + if codelist_item.get('status') == 'withdrawn': + codelist_item.set('status', 'active') return codelist_item def source_to_xml(self):