Skip to content

Commit

Permalink
Merge pull request #488 from EverythingMe/fix/mongo-support-sandbox
Browse files Browse the repository at this point in the history
Fix: Drop database name check in MongoDB queries  to support sandboxed environments
  • Loading branch information
arikfr committed Jul 14, 2015
2 parents 5636cec + e80f470 commit 7d57f9d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions redash/query_runner/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7d57f9d

Please sign in to comment.