diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-01-20 11:46:57 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-01-20 11:46:57 +0100 |
commit | 47f4eaa7509693e0a64ad3ee69b7a312df541127 (patch) | |
tree | 5232bf428003effb1dcad3b23c3d49a976c39894 /ishtar_common/utils.py | |
parent | f5a0acf2638ce5bb31e1e9750f30fbc52cae1577 (diff) | |
download | Ishtar-47f4eaa7509693e0a64ad3ee69b7a312df541127.tar.bz2 Ishtar-47f4eaa7509693e0a64ad3ee69b7a312df541127.zip |
Warehouse: new slug field to prevent ID change when name is changed
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
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"): |