mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
* Add failing test for diffing polymorphic model instances. * Make diffing more robust for polymorphic models: When working with polymorphic models, where a child model inherits from a parent model, Django's pre_save signal may send model instances in a way where the log_update() handler receives an instance of the child as the `old` model, but an instance of the parent as the `new` model. This leads to a `FieldDoesNotExist` error when a field that only exists on the child was modified, and `get_field_value()` attempts look up that field on the parent. This change makes diffing polymorphic models more robust by considering this case in `get_default_value()`. Changes to those child fields won't be tracked in these cases, but at least `django-auditlog` won't prevent the model from being saved. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| templates | ||
| __init__.py | ||
| apps.py | ||
| mask.py | ||
| models.py | ||
| urls.py | ||
| views.py | ||