summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-09-04 20:05:24 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-09-04 20:05:24 +0200
commit057f6d81d5dee5ba8eba2fd959553cf57657990d (patch)
treed7e4c7b4121f09210b398aa4d6bc3830e6e1858e /ishtar_common/models.py
parent843dbe43a597438c62471e2bdc3758db8e2708c0 (diff)
downloadIshtar-057f6d81d5dee5ba8eba2fd959553cf57657990d.tar.bz2
Ishtar-057f6d81d5dee5ba8eba2fd959553cf57657990d.zip
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
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py2
1 files changed, 1 insertions, 1 deletions
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