Add MultipkleObjects exception

This commit is contained in:
littlewolf 2019-10-31 08:49:17 +03:00
parent f259319ade
commit 11a1928346

View File

@ -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