Commit 2dc2e1e8 authored by Adam Tauber's avatar Adam Tauber

[fix] skip invalid encoded attributes

parent 2292e6e1
...@@ -109,14 +109,22 @@ def response(resp): ...@@ -109,14 +109,22 @@ def response(resp):
else: else:
url = build_flickr_url(photo['ownerNsid'], photo['id']) url = build_flickr_url(photo['ownerNsid'], photo['id'])
results.append({'url': url, result = {
'title': title, 'url': url,
'img_src': img_src, 'img_src': img_src,
'thumbnail_src': thumbnail_src, 'thumbnail_src': thumbnail_src,
'content': content,
'author': author,
'source': source, 'source': source,
'img_format': img_format, 'img_format': img_format,
'template': 'images.html'}) 'template': 'images.html'
}
try:
result['author'] = author.encode('utf-8')
result['title'] = title.encode('utf-8')
result['content'] = content.encode('utf-8')
except:
result['author'] = ''
result['title'] = ''
result['content'] = ''
results.append(result)
return results return results
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment