Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogEntry.changes_str fails with KeyError when using m2m_fields #585

Open
moises-perez-tfs opened this issue Nov 9, 2023 · 1 comment
Open

Comments

@moises-perez-tfs
Copy link

LogEntry.changes_str is not able to handle the dictionary obtained when using Many-to-Many (m2m) fields. It expects the values part to always be a list. When using m2m fields values is a dictionary in the form of {'type': 'm2m', 'operation': 'some_action', 'objects': [...]}.

The error raised is an KeyError when trying to access values[0] in line https://github.com/jazzband/django-auditlog/blob/9e987169da37930092417c35f5a7ae1ae11ca623/auditlog/models.py#L416C21-L416C30

@hramezani
Copy link
Member

Thanks @moises-perez-tfs for reporting this.

We are preparing auditlog for V3 major release. and it's in beta.

Could you please try to install django-auditlog from master branch and see if you can reproduce the problem in master?

Also, it would be great if you provide more information like a failing test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants