Commits

Justin Driscoll  committed 0f5d113

Fixed check in admin_thumbnail_view

  • Participants
  • Parent commits c255c12

Comments (0)

Files changed (1)

File imagekit/models.py

 ImageFile.MAXBLOCK = getattr(settings, 'PIL_IMAGEFILE_MAXBLOCK', 256 * 2 ** 10)
 
 # Choice tuples for specifying the crop origin.
-# These are provided for convienience.
+# These are provided for convenience.
 CROP_HORZ_CHOICES = (
     (0, _('left')),
     (1, _('center')),
         pass
         
     def admin_thumbnail_view(self):
+        if not getattr(self, self._ik.image_field, None):
+            return None
         prop = getattr(self, self._ik.admin_thumbnail_spec, None)
         if prop is None:
             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)