From 9a67af7480e4dda124ab710519541ce51789d03b Mon Sep 17 00:00:00 2001 From: Computerboer <58400197+ComputerBoer@users.noreply.github.com> Date: Wed, 30 Jul 2025 23:48:48 +0200 Subject: [PATCH] Adder filter to have lots --- utils/auctionutils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/auctionutils.py b/utils/auctionutils.py index 548ea23..07713be 100644 --- a/utils/auctionutils.py +++ b/utils/auctionutils.py @@ -37,7 +37,10 @@ def getAuctionlocations(countrycode: Countrycode): for auction in auctions: auction.geonamelocation = getGeoLocationByCity(auction.city, countrycode) - + +#filters all auctions for this geonameid + auctions = list(filter(lambda a: a.numberoflots > 0 , auctions)) + geonameids = map(get_geonameid, auctions) uniquegeonameids = (list(set(geonameids))) @@ -45,6 +48,7 @@ def getAuctionlocations(countrycode: Countrycode): #loops through the uniques geonameids for geoid in uniquegeonameids: + #filters all auctions for this geonameid geoauctions = list(filter(lambda a: get_geonameid(a) == geoid , auctions)) if(geoauctions): @@ -179,4 +183,4 @@ def getOVMAuctions(): else: log("The OVM auctions call didn't gave a 200 response but a " + str(response.status_code) + ". With the reason: " + response.reason) - return [] \ No newline at end of file + return []