Can you change this to:

```
_config = settings.DATABASES['mongodb']
if _config.get('USER') and _config.get('PASSWORD'):
    db.authenticate(
        _config['USER'],
        _config['PASSWORD']
    )
```

I don't like that it attempts to do something when it might not be able to do it in a way that could have been prevented.