From 47f4eaa7509693e0a64ad3ee69b7a312df541127 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 20 Jan 2023 11:46:57 +0100 Subject: Warehouse: new slug field to prevent ID change when name is changed --- ishtar_common/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ishtar_common/utils.py') diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 1219dd454..750154e0c 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -577,7 +577,8 @@ def _cached_label_changed(sender, **kwargs): if hasattr(instance, "_cascade_change") and instance._cascade_change: instance.skip_history_when_saving = True instance.__class__.objects.filter(pk=instance.pk).update(**dict(changed)) - if (changed or not cached_labels) and hasattr(instance, "cascade_update"): + if (getattr(instance, "FORCE_CASCADE_UPDATE", False) or changed + or not cached_labels) and hasattr(instance, "cascade_update"): instance.cascade_update() updated = False if force_update or hasattr(instance, "update_search_vector"): -- cgit v1.2.3