X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/31006b86a2e9883d8a4c5fe18128821b325773ab..4fbd1c359e6f2b8b15536179021a6cb0bc3e390c:/apps/fileupload/views.py?ds=sidebyside diff --git a/apps/fileupload/views.py b/apps/fileupload/views.py index 89ccf081..35e0a7ae 100644 --- a/apps/fileupload/views.py +++ b/apps/fileupload/views.py @@ -23,7 +23,11 @@ except ImportError: else: def thumbnail(relpath): try: - return default.backend.get_thumbnail(relpath, "x50").url + thumb = default.backend.get_thumbnail(relpath, "x50") + if not thumb.exists(): + # That's not an image. No thumb. + return None + return thumb.url except IOError: # That's not an image. No thumb. return None