summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-18 10:31:55 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-18 10:31:55 +0200
commit95ecffbefae24654d24581a7bb4778a0d99abf6f (patch)
treef1181e152725dba53b507c69a409bb854e30c16e
parentdda1c10906c6a492342016ee28edd95c75f069db (diff)
downloadIshtar-95ecffbefae24654d24581a7bb4778a0d99abf6f.tar.bz2
Ishtar-95ecffbefae24654d24581a7bb4778a0d99abf6f.zip
Image saving: fix deletion of image
-rw-r--r--ishtar_common/models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 02fbe05b9..02786a8e4 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -585,7 +585,11 @@ class ImageModel(models.Model):
save=False)
if old_path != self.image.path:
- os.remove(old_path)
+ try:
+ os.remove(old_path)
+ except OSError:
+ # already clean
+ pass
# save the thumbnail
self.thumbnail.save(