From 75952dfb3d591802164661325a949d8dbb9a3ac5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 15 May 2018 16:23:25 +0200 Subject: Images: force relocation of image file and creation of symlinks after association (refs #4076) --- ishtar_common/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ishtar_common/models.py b/ishtar_common/models.py index ab70faaa0..97af69417 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3200,6 +3200,14 @@ class ThroughImage(models.Model): ordering = ('-is_main', 'image__name') abstract = True + def save(self, force_insert=False, force_update=False, using=None, + update_fields=None): + super(ThroughImage, self).save( + force_insert=force_insert, force_update=force_update, using=using, + update_fields=update_fields) + # force relocation of image file and creation of symlinks + self.image.save() + if settings.COUNTRY == 'fr': class Arrondissement(models.Model): -- cgit v1.2.3