fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6dc550
)
no thumbnail for no image
author
Jan Szejko
<janek37@gmail.com>
Thu, 2 Feb 2017 13:04:40 +0000
(14:04 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Thu, 2 Feb 2017 13:04:40 +0000
(14:04 +0100)
apps/fileupload/views.py
patch
|
blob
|
history
diff --git
a/apps/fileupload/views.py
b/apps/fileupload/views.py
index
89ccf08
..
35e0a7a
100644
(file)
--- 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