soynatan / django-easy-audit

Yet another Django audit log app, hopefully the simplest one.
GNU General Public License v3.0
740 stars 182 forks source link

ImproperlyConfigured error raised in auth_signals.py when using multiple databases #229

Open LukaRiba opened 2 years ago

LukaRiba commented 2 years ago

In user_logged_in, user_logged_out and user_login_failed receiver functions (signals/auth_signals.py), argument 'using' is not passed to transaction.atomic(), so execption is raised when multiple databases are used. When I changed with transaction.atomic(): line to with transaction.atomic(using=DATABASE_ALIAS):, all logging events have been successfully written into database. I suppose this is the issue as in signals/model_signals.py, DATABASE_ALIAS is passed as 'using' argument to transaction.atomic() calls.

jheld commented 2 years ago

Do you have time in the short term to create a PR?

mschoettle commented 2 years ago

I have two databases set up (one called “default”) and this issue does not occur there. Is this in the case where there is no default database?