diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-05-15 16:23:25 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-12 08:44:34 +0200 | 
| commit | 02625b337570ff5cc53c00770c36cc14b12aa8b8 (patch) | |
| tree | 9d89adb1a370dcb49ba47f98131d3d522f67c14d | |
| parent | 4990c34c3f352368b4b30fb0f441ffb9352c5b96 (diff) | |
| download | Ishtar-02625b337570ff5cc53c00770c36cc14b12aa8b8.tar.bz2 Ishtar-02625b337570ff5cc53c00770c36cc14b12aa8b8.zip | |
Images: force relocation of image file and creation of symlinks after association (refs #4076)
| -rw-r--r-- | ishtar_common/models.py | 8 | 
1 files changed, 8 insertions, 0 deletions
| 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): | 
