Skip to content

Commit 1f50265

Browse files
authored
Merge pull request #29 from AfricasVoices/skip-empty-contact-urns
Hotfix: Skip empty contact_urns
2 parents c922a99 + f221f10 commit 1f50265

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fetch_runs/fetch_runs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
continue
105105

106106
contact_urns = contact_runs[run.contact.uuid].urns
107+
108+
if len(contact_urns) == 0:
109+
print("Warning: Ignoring contact with no urn. URNs: {}, UUID: {}".format(contact_urns, run.contact.uuid))
110+
continue
111+
107112
# assert len(contact_urns) == 1, "Contact has multiple URNs" TODO: Re-enable once AVF test runs are ignored.
108113
run_dict = {"avf_phone_id": phone_uuids.add_phone(contact_urns[0])}
109114

0 commit comments

Comments
 (0)