diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-05-11 12:33:54 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-12 08:44:18 +0200 |
commit | 83d4e47b7e0ee3946e07d1c5de04597a06613cf0 (patch) | |
tree | 67981f597f7b7a98b782d2db02687d83f1024772 /ishtar_common/models.py | |
parent | 3d12b0ac2e97ab43a555106f404ed7cf442caf17 (diff) | |
download | Ishtar-83d4e47b7e0ee3946e07d1c5de04597a06613cf0.tar.bz2 Ishtar-83d4e47b7e0ee3946e07d1c5de04597a06613cf0.zip |
Migrate single image to M2M (refs #4076)
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 0e8d96ddb..53f4e1c11 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -865,6 +865,9 @@ class ItemKey(models.Model): def get_image_path(instance, filename): + # when using migrations instance is not a real ImageModel instance + if not hasattr(instance, '_get_image_path'): + return u"upload/{}".format(filename) return instance._get_image_path(filename) |