Updates to_model to use fields

This commit is contained in:
Mouse Reeve
2020-12-03 12:35:57 -08:00
parent 1610d81ce6
commit a85043b351
7 changed files with 78 additions and 66 deletions

View File

@ -8,6 +8,7 @@ from django.db import transaction
from dateutil import parser
import requests
from requests import HTTPError
from requests.exceptions import SSLError
from bookwyrm import models
@ -322,7 +323,7 @@ def get_image(url):
''' wrapper for requesting an image '''
try:
resp = requests.get(url)
except RequestError:
except (RequestError, SSLError):
return None
if not resp.ok:
return None