Skip to content

Commit 92573e0

Browse files
authored
Merge pull request #180 from cmu-delphi/staging
Staging
2 parents e419277 + c546035 commit 92573e0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/indicators/resources.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ def process_pathogens(row) -> None:
6363

6464

6565
def 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(name=indicator_set_name)
71+
indicator_set_id = indicator_set_obj.id
72+
except IndicatorSet.DoesNotExist:
73+
logger.warning(f"Indicator Set '{indicator_set_name}' not found.")
74+
row["Indicator Set"] = indicator_set_id
7575

7676

7777
def process_indicator_type(row) -> None:
@@ -504,7 +504,7 @@ class OtherEndpointIndicatorResource(ModelResource):
504504
pathogens = Field(
505505
attribute="pathogens",
506506
column_name="Pathogen/\nDisease Area",
507-
widget=ManyToManyWidget(Pathogen, field="name", separator=","),
507+
widget=ManyToManyWidget(Pathogen),
508508
)
509509
indicator_type = Field(
510510
attribute="indicator_type",

0 commit comments

Comments
 (0)