From 1f16014274a2ad16fcd635fc9b506ef429a33677 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 4 Sep 2013 20:05:24 +0200 Subject: Improve Image field management (refs #1365) * add a custom widget to allow display via prettyPhoto on forms * disable resizing when the image is deleted * fix "has image" search request to manage empty and null field for images * fix deletion of files by the wizard * fix initialization of instancied form for files and images --- ishtar_common/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index fb6bebed7..e1ca73a3b 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -291,7 +291,7 @@ class ImageModel(models.Model): def save(self, *args, **kwargs): # manage images - if self.has_changed('image'): + if self.has_changed('image') and self.image: # convert to jpg filename = os.path.splitext(os.path.split(self.image.name)[-1])[0] old_path = self.image.path -- cgit v1.2.3