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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user