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 | b4ac13179c5ec79c8293f2cfb243c4fea611fdc8 (patch) | |
tree | f1181e152725dba53b507c69a409bb854e30c16e /ishtar_common | |
parent | 50a4d552ef860b187c12a7a0701bf7848047ce27 (diff) | |
download | Ishtar-b4ac13179c5ec79c8293f2cfb243c4fea611fdc8.tar.bz2 Ishtar-b4ac13179c5ec79c8293f2cfb243c4fea611fdc8.zip |
Image saving: fix deletion of image
Diffstat (limited to 'ishtar_common')
-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( |