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

Option to disable logging on raw save and via context manager #446

Merged
merged 12 commits into from
Nov 4, 2022

Conversation

robinharms
Copy link
Contributor

Related to this issue: #443

Since m2ms don't have the kwarg raw, I've added a context manager that can be used in situations when things shouldn't be logged.

My use-case is essentially large imports on a live server.

@robinharms
Copy link
Contributor Author

Btw I haven't added anything in the docs yet. If you want to merge I'll fix that of course.

@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #446 (1722aa4) into master (aa6d977) will increase coverage by 0.12%.
The diff coverage is 92.00%.

@@            Coverage Diff             @@
##           master     #446      +/-   ##
==========================================
+ Coverage   92.30%   92.43%   +0.12%     
==========================================
  Files          24       24              
  Lines         728      753      +25     
==========================================
+ Hits          672      696      +24     
- Misses         56       57       +1     
Impacted Files Coverage Δ
auditlog/context.py 82.92% <77.77%> (-1.45%) ⬇️
auditlog/conf.py 100.00% <100.00%> (ø)
auditlog/receivers.py 100.00% <100.00%> (ø)
auditlog/registry.py 98.54% <100.00%> (+0.02%) ⬆️
auditlog/models.py 87.55% <0.00%> (+0.42%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hramezani
Copy link
Member

Thanks @robinharms for this change. In general it LGTM 👍
I left some comments.
Please remember adding:

  • changelog entry
  • documentation for this new setting and context manager

@robinharms
Copy link
Contributor Author

All done!

Note that I assumed the next release was 2.2.0 so I used that in the docs.

Sorry about the initial bad code ;)

CHANGELOG.md Outdated Show resolved Hide resolved
@hramezani
Copy link
Member

All done!

Note that I assumed the next release was 2.2.0 so I used that in the docs.

Sorry about the initial bad code ;)

Thanks for the update. I left a small suggestion.
Also, we have some syntax problems in the new docs added https://github.com/jazzband/django-auditlog/actions/runs/3385622412/jobs/5624027992. Please fix it as well.

@robinharms
Copy link
Contributor Author

Ah, missed the :: marker. Sorry

Copy link
Member

@hramezani hramezani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@hramezani
Copy link
Member

Thanks @robinharms for your effort!
Let's don't merge it for now, to let the other people review it.
I will merge it in next couple of days.

@hramezani hramezani merged commit 8fe776a into jazzband:master Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants