Fix M2M Logging for Event Types (Fixes Issue #324) #327
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✅ Summary
This PR addresses Issue #324, which involves the lack of logging for Many-to-Many (M2M) field changes in the
django-easy-audit
package. Specifically, it ensures that events related to M2M add, remove, and clear actions are properly logged, enabling full auditing capabilities for M2M fields.🔧 What was done?
Test Coverage:
Details of Changes:
M2M_ADD
: Logs when tags are added to an article (Many-to-Many Add).M2M_REMOVE
: Logs when tags are removed from an article (Many-to-Many Remove).M2M_CLEAR
: Logs when all tags are cleared from an article (Many-to-Many Clear).🔍 Why is this needed?
Previously, changes to Many-to-Many fields were not being captured correctly by the audit logging system, leading to incomplete event tracking. This PR ensures full auditing coverage for M2M field changes.
🛠️ Testing:
M2M_ADD
,M2M_REMOVE
,M2M_CLEAR
).🔗 Related Issue
Fixes #324
Tested with Django 5.2 and Python 3.12.