Use a sentinel as default value for setting attribute only if changed

For new instances, we must set also the attribute with value `None` as they may
be tested later.

Closes #15060
This commit is contained in:
Cédric Krier
2026-09-03 15:49:20 +02:00
parent f604a31f14
commit e936e37d8f
+1 -1
View File
@@ -188,6 +188,6 @@ class IdentifiersMixin(IdentifiersUpdateMixin):
def setattr_changed(record, name, value):
if getattr(record, name, None) != value:
if getattr(record, name, object()) != value:
setattr(record, name, value)
return True