mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-16 21:30:23 +00:00
Fixed IKModel.delete file locking bug
This commit is contained in:
parent
0dfabd1d7b
commit
8a0bd9c5a9
2 changed files with 5 additions and 3 deletions
|
|
@ -49,9 +49,10 @@ class IKModel(models.Model):
|
|||
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>' % \
|
||||
|
|
@ -106,4 +107,4 @@ class IKModel(models.Model):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class Options(object):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue