From dcaf88795c06b151ca32ca9b79b2043c4068f45c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 24 Jan 2019 00:22:25 +0100 Subject: Migration optimization: no move of doc on index gen --- ishtar_common/models.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ishtar_common/models.py') 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 -- cgit v1.2.3