Skip to content

Commit

Permalink
Merge 5b31685 into fcf15be
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettc committed Feb 25, 2022
2 parents fcf15be + 5b31685 commit 3cce1ac
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions ditto/flickr/fetch/fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,29 @@ def _call_api(self, nsid):
try:
info = self.api.people.getInfo(user_id=nsid)
except FlickrError as e:
# User has deleted their account, so create a dummy result
if e.code == 5:
self.results = [
{
"raw": "{}",
"nsid": nsid,
"ispro": False,
"iconserver": "0",
"iconfarm": "0",
"username": {"_content": "deleted_user_" + nsid},
"realname": {"_content": "Deleted User"},
"description": {"_content": "Deleted User"},
"photosurl": {"_content": "deleted_user"},
"profileurl": {"_content": "deleted_user"},
"photos": {
"count": {"_content": "0"},
"firstdate": {"_content": "0"},
"firstdatetaken": {"_content": "1970-01-01 00:00:00"},
},
}
]
return

raise FetchError(
"Error when getting info about User with Flickr ID '%s': %s" % (nsid, e)
)
Expand Down Expand Up @@ -250,8 +273,7 @@ def _fetch_and_save_avatar(self, user):


class PhotosFetcher(Fetcher):
"""Parent class for fetching and saving data about Photos for an Account.
"""
"""Parent class for fetching and saving data about Photos for an Account."""

def __init__(self, *args, **kwargs):
# Will match Flickr IDs with their User object.
Expand Down

0 comments on commit 3cce1ac

Please sign in to comment.