fixed changing ovm auction api
This commit is contained in:
@@ -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
|
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", "")
|
startdatetime = result['openingsDatumISO'].replace("T", " ").replace("Z", "")
|
||||||
enddatetime = result['sluitingsDatumISO'].replace("T", " ").replace("Z", "")
|
enddatetime = result['sluitingsDatumISO'].replace("T", " ").replace("Z", "")
|
||||||
firstimage = result['imageList'][0]
|
image = "";
|
||||||
image = firstimage if firstimage else ""
|
#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'] )
|
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)
|
auctions.append(a)
|
||||||
Cache.add(cachename, auctions)
|
Cache.add(cachename, auctions)
|
||||||
|
|||||||
Reference in New Issue
Block a user