mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
MongoDB: fix for empty username/password (#7487)
This commit is contained in:
@@ -215,10 +215,10 @@ class MongoDB(BaseQueryRunner):
|
|||||||
if readPreference:
|
if readPreference:
|
||||||
kwargs["readPreference"] = readPreference
|
kwargs["readPreference"] = readPreference
|
||||||
|
|
||||||
if "username" in self.configuration:
|
if self.configuration.get("username"):
|
||||||
kwargs["username"] = self.configuration["username"]
|
kwargs["username"] = self.configuration["username"]
|
||||||
|
|
||||||
if "password" in self.configuration:
|
if self.configuration.get("password"):
|
||||||
kwargs["password"] = self.configuration["password"]
|
kwargs["password"] = self.configuration["password"]
|
||||||
|
|
||||||
db_connection = pymongo.MongoClient(self.configuration["connectionString"], **kwargs)
|
db_connection = pymongo.MongoClient(self.configuration["connectionString"], **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user