Configure actions in auditlog.register#682
Configure actions in auditlog.register#682CleitonDeLima wants to merge 1 commit intojazzband:masterfrom
Conversation
4b33529 to
759f8ac
Compare
759f8ac to
910f1bf
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #682 +/- ##
==========================================
+ Coverage 95.21% 95.49% +0.27%
==========================================
Files 31 32 +1
Lines 1025 1088 +63
==========================================
+ Hits 976 1039 +63
Misses 49 49 ☔ View full report in Codecov by Sentry. |
|
Thanks @CleitonDeLima for this PR. I think this PR will introduce a breaking change. the In the current implementation, we can have multiple instances of from auditlog.registry import AuditlogModelRegistry, auditlog
auditlog.register(MyModel) # registers model with all actions
custom_auditlog = AuditlogModelRegistry(delete=False, access=False)
custom_auditlog.register(MyOtherModel)This will not be possible by your change and some people's code might depend on this. Also, by moving the adding to from auditlog.registry import auditlog
auditlog.register(MyModel) # registers model with all actions
# This will change the signals in `_signals` for the whole instance and will change the log behavior for all registered model
custom_auditlog.register(MyOtherModel, actions={'DELETE': False})I think the Please remember to add more tests and change the documentation if you want to continue. |
|
Hi @hramezani, thanks for reviewing
Is it possible to have multiple instances? It seems to me that the application currently does not support this. The
This really is weird, I'll think of an alternative.
I'll see how it works to change the documentation for this, it's a new world for me 😄. |
Resolve #424