Skip to content

support optional DB alias for old instance lookup #758

@2ykwang

Description

@2ykwang

code: https://github.com/jazzband/django-auditlog/blob/v3.2.1/auditlog/receivers.py#L50-L68

proposal: change auditlog to default to using instance._state.db when querying for the old instance

old instances may be queried against the wrong database in a multi-DB setup,
leading to cases where auditlog fails to find the previous state or records incorrect diffs
(for example, in a DB replication environment, replication lag could cause unexpected behavior).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions