From 1097cf9fb7f853b5a33480ad27e8683634abf491 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 13 Sep 2019 14:35:29 +0200 Subject: Fix cascade update of author when no BG task is set --- ishtar_common/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 4f82a1663..d5450916b 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2124,8 +2124,10 @@ class BaseHistorizedItem(StatisticItem, TemplateItem, FullSearch, Imported, def cascade_update(self): for down_model in self.DOWN_MODEL_UPDATE: if not settings.USE_BACKGROUND_TASK: - getattr(self, down_model).update(need_update=True) - continue + rel = getattr(self, down_model) + if hasattr(rel.model, "need_update"): + rel.update(need_update=True) + continue for item in getattr(self, down_model).all(): cached_label_changed(item.__class__, instance=item) if hasattr(item, "point_2d"): -- cgit v1.2.3