admin_thumbnail_view no longer crashes when there is no file found

This commit is contained in:
Justin Driscoll 2009-03-13 12:35:33 -04:00
parent e0a2ad9ede
commit e03edf8e83

View file

@ -78,6 +78,8 @@ class ImageModel(models.Model):
return 'An "%s" image spec has not been defined.' % \
self._ik.admin_thumbnail_spec
else:
if not prop._exists():
return None
if hasattr(self, 'get_absolute_url'):
return u'<a href="%s"><img src="%s"></a>' % \
(self.get_absolute_url(), prop.url)