From 69548e8c1e41224367e02d88fc4394729937408c Mon Sep 17 00:00:00 2001 From: Computerboer Date: Wed, 10 Apr 2024 20:32:28 +0200 Subject: [PATCH] fixed changing ovm auction api --- utils/auctionutils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/auctionutils.py b/utils/auctionutils.py index 60b12f6..fb8c12b 100644 --- a/utils/auctionutils.py +++ b/utils/auctionutils.py @@ -164,8 +164,12 @@ def getOVMAuctions(): cityname = "Nederland" if cityname is None else cityname #there can be auctions where you have to make an appointment to retrieve the lots startdatetime = result['openingsDatumISO'].replace("T", " ").replace("Z", "") enddatetime = result['sluitingsDatumISO'].replace("T", " ").replace("Z", "") - firstimage = result['imageList'][0] - image = firstimage if firstimage else "" + image = ""; + #if hasattr(result, 'image') : #result['image'] : + image = result.get('image', "") #['image'] + if image == "": + image = result.get('imageList', [""])[0] + a = Auction(Auctionbrand.OVM, cityname,result['land'], result['naam'],startdatetime, enddatetime, str(result['land']).lower() + '/veilingen/' + str(result['id']) + '/kavels', 'images/150x150/' + image, result['totaalKavels'] ) auctions.append(a) Cache.add(cachename, auctions)