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 | af04b1ecfc22f8c104f6f960c26086c4284e9777 (patch) | |
tree | 5232bf428003effb1dcad3b23c3d49a976c39894 /ishtar_common/utils.py | |
parent | 931092752a4db520becea7815e0d1e205b0a921e (diff) | |
download | Ishtar-af04b1ecfc22f8c104f6f960c26086c4284e9777.tar.bz2 Ishtar-af04b1ecfc22f8c104f6f960c26086c4284e9777.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"): |