Handle no images" && fab dep re

"
master
Nick Sergeant 2012-07-08 14:54:11 -04:00
parent 67bf326c15
commit 32d7f19fc0
1 changed files with 6 additions and 1 deletions

View File

@ -22,8 +22,13 @@ def amazon_search(request):
result = []
for product in products:
if product.small_image_url:
small_image_url = product.small_image_url.replace('http://ecx.images-amazon.com/images/I/', '')
else:
small_image_url = None
result.append({
'image': product.small_image_url.replace('http://ecx.images-amazon.com/images/I/', ''),
'image': small_image_url,
'price': product.list_price,
'review': striptags(product.editorial_review),
'reviews': product.reviews,