Add MultipkleObjects exception
This commit is contained in:
parent
f259319ade
commit
11a1928346
|
|
@ -117,6 +117,8 @@ def transfer_establishment_addresses():
|
|||
|
||||
try:
|
||||
location = Address.objects.get(old_id=old_establishment.location_id)
|
||||
except Address.MultipleObjectsReturned:
|
||||
location = Address.objects.filter(old_id=old_establishment.location_id).first()
|
||||
except Address.DoesNotExist:
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user