You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a fallback implementation that's actually never called because it's missing the default param of getattr function. Here is what I'm talking about:
Instead of getattr(settings, 'SLAVE_DATABASES') if should be getattr(settings, 'SLAVE_DATABASES', None).
Another option that might be even better would be hasattr(settings, 'SLAVE_DATABASES').
The text was updated successfully, but these errors were encountered:
seocam
changed the title
Multdb raises exception if SLAVE_DATABASES is not defined in settings
Multidb raises exception if SLAVE_DATABASES is not defined in settings
May 3, 2018
There is a fallback implementation that's actually never called because it's missing the default param of getattr function. Here is what I'm talking about:
django-multidb-router/multidb/__init__.py
Line 43 in 86017d2
Instead of
getattr(settings, 'SLAVE_DATABASES')
if should begetattr(settings, 'SLAVE_DATABASES', None)
.Another option that might be even better would be
hasattr(settings, 'SLAVE_DATABASES')
.The text was updated successfully, but these errors were encountered: