making sure the routing is only applied to listings which are not done already

This commit is contained in:
Kadir 2024-04-05 11:38:09 +01:00
parent 966b9007a0
commit b5e316d1df

View file

@ -9,7 +9,7 @@ BROCK_STREET_LAT_LONG = 51.52570434674584, -0.13956495005056113
filtered_listings = []
for listing in listings:
miles = geodesic(BROCK_STREET_LAT_LONG, (listing.latitude, listing.longitude)).miles
if miles <= 7:
if miles <= 7 and not listing.path_routing_json().exists():
filtered_listings.append(listing)
print(f"Filtered listings from {len(listings)} to {len(filtered_listings)}")