Skip to content

Commit a6298f2

Browse files
MongoDB: fix for empty username/password (#7487)
1 parent e69283f commit a6298f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redash/query_runner/mongodb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ def _get_db(self):
215215
if readPreference:
216216
kwargs["readPreference"] = readPreference
217217

218-
if "username" in self.configuration:
218+
if self.configuration.get("username"):
219219
kwargs["username"] = self.configuration["username"]
220220

221-
if "password" in self.configuration:
221+
if self.configuration.get("password"):
222222
kwargs["password"] = self.configuration["password"]
223223

224224
db_connection = pymongo.MongoClient(self.configuration["connectionString"], **kwargs)

0 commit comments

Comments
 (0)