summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit02625b337570ff5cc53c00770c36cc14b12aa8b8 (patch)
tree9d89adb1a370dcb49ba47f98131d3d522f67c14d
parent4990c34c3f352368b4b30fb0f441ffb9352c5b96 (diff)
downloadIshtar-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.py8
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):