fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tag forms (unused for now)
[redakcja.git]
/
apps
/
fileupload
/
views.py
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:
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
except IOError:
# That's not an image. No thumb.
return None