diff options
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 |
commit | 95ecffbefae24654d24581a7bb4778a0d99abf6f (patch) | |
tree | f1181e152725dba53b507c69a409bb854e30c16e | |
parent | dda1c10906c6a492342016ee28edd95c75f069db (diff) | |
download | Ishtar-95ecffbefae24654d24581a7bb4778a0d99abf6f.tar.bz2 Ishtar-95ecffbefae24654d24581a7bb4778a0d99abf6f.zip |
Image saving: fix deletion of image
-rw-r--r-- | ishtar_common/models.py | 6 |
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( |