Commit 8ae35147 authored by Dan Pascu's avatar Dan Pascu

Extended the cases for which we fetch the alternate icon

parent aa2b17b4
...@@ -503,7 +503,7 @@ class GoogleContactIconRetriever(object): ...@@ -503,7 +503,7 @@ class GoogleContactIconRetriever(object):
log.error(u"could not store icon for {}: {!s}".format(self.contact.name, e)) log.error(u"could not store icon for {}: {!s}".format(self.contact.name, e))
else: else:
icon.downloaded_url = icon.url icon.downloaded_url = icon.url
elif response['status'] == '403' and icon.alternate_url: # private photo. use old GData protocol if alternate_url is available elif response['status'] in ('403', '404') and icon.alternate_url: # private or unavailable photo. use old GData protocol if alternate_url is available.
try: try:
response, content = http.request(icon.alternate_url, headers={'GData-Version': '3.0'}) response, content = http.request(icon.alternate_url, headers={'GData-Version': '3.0'})
except (HttpLib2Error, socket.error) as e: except (HttpLib2Error, socket.error) as e:
......
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