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 | 75952dfb3d591802164661325a949d8dbb9a3ac5 (patch) | |
tree | 9d89adb1a370dcb49ba47f98131d3d522f67c14d | |
parent | 0adadd4d3f40ee313e392886fab1080e1bee4f92 (diff) | |
download | Ishtar-75952dfb3d591802164661325a949d8dbb9a3ac5.tar.bz2 Ishtar-75952dfb3d591802164661325a949d8dbb9a3ac5.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): |