diff --git a/importers/helpers/__init__.py b/importers/helpers/__init__.py index da4963f..cbbf0ab 100644 --- a/importers/helpers/__init__.py +++ b/importers/helpers/__init__.py @@ -130,6 +130,12 @@ def update_codelist_item(self, codelist_item, code_dict, namespaces=None): else: narrative = codelist_item.xpath(k, namespaces=namespaces)[0] narrative.text = v + if '@status' not in code_dict.keys(): + # This code exists, so it should be set to be active, unless + # 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') return codelist_item def source_to_xml(self):