Skip to content

Commit f2498f3

Browse files
authored
Merge pull request #174 from cmu-delphi/staging
Staging
2 parents 326e590 + 2056aea commit f2498f3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/indicatorsets/resources.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,18 @@ class Meta:
224224
"epidata_endpoint",
225225
)
226226

227+
def get_instance(self, instance_loader, row):
228+
name = row.get("Indicator Set name* ")
229+
230+
# Try to match by (name, source)
231+
if name:
232+
try:
233+
return self._meta.model.objects.get(name=name)
234+
except self._meta.model.DoesNotExist:
235+
pass
236+
237+
return None
238+
227239
def skip_row(self, instance, original, row, import_validation_errors=None):
228240
if not row["Include in indicator app"]:
229241
return True

0 commit comments

Comments
 (0)