forked from mirrors/bookwyrm
Handle all kinds of invalid image urls
This commit is contained in:
parent
8609c8eb79
commit
f1d4f092f2
1 changed files with 4 additions and 1 deletions
|
@ -319,7 +319,10 @@ def upload_cover(request, book_id):
|
|||
|
||||
def set_cover_from_url(url):
|
||||
"""load it from a url"""
|
||||
image_file = get_image(url)
|
||||
try:
|
||||
image_file = get_image(url)
|
||||
except: # pylint: disable=bare-except
|
||||
return None
|
||||
if not image_file:
|
||||
return None
|
||||
image_name = str(uuid4()) + "." + url.split(".")[-1]
|
||||
|
|
Loading…
Reference in a new issue