1. Davor Lucic
  2. django-imagekit

Commits

Justin Driscoll  committed 103ac5f

Fixed IKModel.delete file locking bug

  • Participants
  • Parent commits 1404527
  • Branches default

Comments (0)

Files changed (2)

File src/imagekit/models.py

View file
         pass
         
     def admin_thumbnail_view(self):
-        prop = getattr(self, 'admin_thumbnail', None)
+        prop = getattr(self, self._ik.admin_thumbnail_spec, None)
         if prop is None:
-            return 'An "admin_thumbnail" image spec has not been defined.'
+            return 'An "%s" image spec has not been defined.' % \
+              self._ik.admin_thumbnail_spec
         else:
             if hasattr(self, 'get_absolute_url'):
                 return u'<a href="%s"><img src="%s"></a>' % \
     def delete(self):
         assert self._get_pk_val() is not None, "%s object can't be deleted because its %s attribute is set to None." % (self._meta.object_name, self._meta.pk.attname)
         self._clear_cache()
-        super(IKModel, self).delete()
+        models.Model.delete(self)

File src/imagekit/options.py

View file
     cache_dir = 'images'
     save_count_as = None
     cache_filename_format = "%(filename)s_%(specname)s.%(extension)s"
+    admin_thumbnail_spec = 'admin_thumbnail'
     spec_module = 'imagekit.config'
     
     def __init__(self, opts):