django-easy-audit icon indicating copy to clipboard operation
django-easy-audit copied to clipboard

ImproperlyConfigured error raised in auth_signals.py when using multiple databases

Open LukaRiba opened this issue 3 years ago • 2 comments
trafficstars

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.

LukaRiba avatar May 23 '22 14:05 LukaRiba

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

jheld avatar May 24 '22 18:05 jheld

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?

mschoettle avatar May 25 '22 23:05 mschoettle