summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-24 00:22:25 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-24 00:24:22 +0100
commitab651277d8f70c9930481b1b578a762c7eedd1b3 (patch)
treebf0274bf59a8f1a5274dda361d1a287cd1c708cd /ishtar_common/models.py
parenteed2faa799218a45b362fe7d66dec588b24ecf15 (diff)
downloadIshtar-ab651277d8f70c9930481b1b578a762c7eedd1b3.tar.bz2
Ishtar-ab651277d8f70c9930481b1b578a762c7eedd1b3.zip
Migration optimization: no move of doc on index gen
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index e04efbcab..425ee2a8d 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -4098,6 +4098,8 @@ class Document(BaseHistorizedItem, OwnPerms, ImageModel):
:return: list of associated links
"""
+ if getattr(self, "_no_move", False):
+ return
reference_path = None
initial_path = self.image.path
filename = os.path.basename(initial_path)
@@ -4174,6 +4176,8 @@ class Document(BaseHistorizedItem, OwnPerms, ImageModel):
if self.image and not no_path_change and \
not getattr(self, '_no_path_change', False):
links = self._move_image()
+ if not links:
+ return
links = self.LINK_SPLIT.join(links)
if links != self.associated_links:
self.associated_links = links