Skip to content

Multidb raises exception if SLAVE_DATABASES is not defined in settings #39

@seocam

Description

@seocam

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:

if getattr(settings, 'SLAVE_DATABASES'):

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').

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions