Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[fix] skip invalid encoded attributes

parent 2292e6e1
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -109,14 +109,22 @@ def response(resp):
        else:
            url = build_flickr_url(photo['ownerNsid'], photo['id'])

        results.append({'url': url,
                        'title': title,
        result = {
            'url': url,
            'img_src': img_src,
            'thumbnail_src': thumbnail_src,
                        'content': content,
                        'author': author,
            'source': source,
            '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