Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/indicators/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def process_pathogens(row) -> None:


def process_indicator_set(row) -> None:
indicator_set_id = None
if row["Indicator Set"]:
indicator_set_name = row["Indicator Set"].strip()
indicator_set_obj = IndicatorSet.objects.get(
name=indicator_set_name
)
if indicator_set_obj:
row["Indicator Set"] = indicator_set_obj.id
else:
row["Indicator Set"] = None
try:
indicator_set_obj = IndicatorSet.objects.get(name=indicator_set_name)
indicator_set_id = indicator_set_obj.id
except IndicatorSet.DoesNotExist:
logger.warning(f"Indicator Set '{indicator_set_name}' not found.")
row["Indicator Set"] = indicator_set_id


def process_indicator_type(row) -> None:
Expand Down Expand Up @@ -504,7 +504,7 @@ class OtherEndpointIndicatorResource(ModelResource):
pathogens = Field(
attribute="pathogens",
column_name="Pathogen/\nDisease Area",
widget=ManyToManyWidget(Pathogen, field="name", separator=","),
widget=ManyToManyWidget(Pathogen),
)
indicator_type = Field(
attribute="indicator_type",
Expand Down
Loading