File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,18 @@ def process_pathogens(row) -> None:
6363
6464
6565def process_indicator_set (row ) -> None :
66+ indicator_set_id = None
6667 if row ["Indicator Set" ]:
6768 indicator_set_name = row ["Indicator Set" ].strip ()
68- indicator_set_obj = IndicatorSet .objects .get (
69- name = indicator_set_name
70- )
71- if indicator_set_obj :
72- row ["Indicator Set" ] = indicator_set_obj .id
73- else :
74- row ["Indicator Set" ] = None
69+ try :
70+ indicator_set_obj = IndicatorSet .objects .get (
71+ name = indicator_set_name
72+ )
73+ indicator_set_id = indicator_set_obj .id
74+ except IndicatorSet .DoesNotExist :
75+ logger .warning (f"Indicator Set '{ indicator_set_name } ' not found." )
76+ row ["Indicator Set" ] = indicator_set_id
77+
7578
7679
7780def process_indicator_type (row ) -> None :
You can’t perform that action at this time.
0 commit comments