From b67f219ce2f8d4005248a133c6897aa83cf98607 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Mon, 16 Sep 2019 13:48:16 +0200 Subject: [PATCH] Return first zip when search by subbisivion and country with multiples zips --- address.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/address.py b/address.py index 8d957bc..6155c87 100644 --- a/address.py +++ b/address.py @@ -25,7 +25,7 @@ class Address: zips = Zip.search([ ('zip', '=', self.zip), ('subdivision.country', '=', self.country.id), - ]) + ], limit=1) if zips: zip_, = zips self.city = zip_.city