From e80f4702559e2139123db9c88a2f9c5745fd42f3 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 14 Jul 2015 08:51:31 +0300 Subject: [PATCH] Mongo: Drop database name check to support sandboxed environments --- redash/query_runner/mongodb.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/redash/query_runner/mongodb.py b/redash/query_runner/mongodb.py index 2ab6136fd6..bf24d65807 100644 --- a/redash/query_runner/mongodb.py +++ b/redash/query_runner/mongodb.py @@ -162,10 +162,7 @@ def run_query(self, query): else: db_connection = pymongo.MongoClient(self.configuration["connectionString"]) - if self.db_name not in db_connection.database_names(): - return None, "Unknown database name '%s'" % self.db_name - - db = db_connection[self.db_name ] + db = db_connection[self.db_name] logger.debug("mongodb connection string: %s", self.configuration['connectionString']) logger.debug("mongodb got query: %s", query) @@ -226,9 +223,6 @@ def run_query(self, query): columns = [] rows = [] - error = None - json_data = None - cursor = None if q or (not q and not aggregate): if s: