Skip to content

Commit

Permalink
Set status to active if the codelist exists, and the status has not o…
Browse files Browse the repository at this point in the history
…therwise been specified, fixes #70
  • Loading branch information
markbrough committed Nov 8, 2023
1 parent 341b3c3 commit 76bb085
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions importers/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 76bb085

Please sign in to comment.