Commits

Jose Luis Di Biase  committed 97a092e

If catch more than one placemark get the first one

  • Participants
  • Parent commits dcffaf6

Comments (0)

Files changed (1)

File easy_maps/models.py

             else:
                 g = geocoders.Google(resource='maps')
             address = smart_str(self.address)
-            self.computed_address, (self.latitude, self.longitude,) = g.geocode(address)
+            self.computed_address, (self.latitude, self.longitude,) = g.geocode(address, exactly_one=False)[0]
             self.geocode_error = False
         except (UnboundLocalError, ValueError,geocoders.google.GQueryError):
             self.geocode_error = True