Skip to content
  • Sean Griffin's avatar
    02e6bccb
    Don't crash when mutating attributes in a getter · 02e6bccb
    Sean Griffin authored
    If a getter has side effects on the DB, `changes_applied` will be called
    twice. The second time will try and remove the changed attributes cache,
    and will crash because it's already been unset. This also demonstrates
    that we shouldn't assume that calling getters won't change the value of
    `changed_attributes`, and we need to clear the cache if an attribute is
    modified.
    
    Fixes #20531.
    02e6bccb
    Don't crash when mutating attributes in a getter
    Sean Griffin authored
    If a getter has side effects on the DB, `changes_applied` will be called
    twice. The second time will try and remove the changed attributes cache,
    and will crash because it's already been unset. This also demonstrates
    that we shouldn't assume that calling getters won't change the value of
    `changed_attributes`, and we need to clear the cache if an attribute is
    modified.
    
    Fixes #20531.
Loading