From b4ac13179c5ec79c8293f2cfb243c4fea611fdc8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 18 Aug 2016 10:31:55 +0200 Subject: Image saving: fix deletion of image --- ishtar_common/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') 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( -- cgit v1.2.3