summaryrefslogtreecommitdiff
path: root/ishtar_common/models_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r--ishtar_common/models_common.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index c623a0604..79aa66953 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -1051,7 +1051,8 @@ class FullSearch(models.Model):
m2m_search_vector.key, config=m2m_search_vector.language
)
).values("search")
- search_vectors.append(q.all()[0]["search"])
+ if q.count():
+ search_vectors.append(q.all()[0]["search"])
# int/float are not well managed by the SearchVector
for int_search_vector in self.INT_SEARCH_VECTORS:
@@ -1875,6 +1876,16 @@ class BaseHistorizedItem(
self.fix_associated()
return True
+ def no_post_process(self, history=False):
+ if not history:
+ self.skip_history_when_saving = True
+ self._cached_label_checked = True
+ self._post_saved_geo = True
+ self._external_id_checked = True
+ self._search_updated = True
+ self._no_move = True
+ self._no_down_model_update = True
+
class LightHistorizedItem(BaseHistorizedItem):
history_date = models.DateTimeField(default=datetime.datetime.now)
@@ -3284,15 +3295,6 @@ class MainItem(ShortMenuItem, SerializeItem, SheetItem):
if hasattr(item, "main_geodata"):
item.post_save_geo()
- def no_post_process(self):
- self.skip_history_when_saving = True
- self._cached_label_checked = True
- self._post_saved_geo = True
- self._external_id_checked = True
- self._search_updated = True
- self._no_move = True
- self._no_down_model_update = True
-
@classmethod
def app_label(cls):
return cls._meta.app_label