check for default database on mongo connection

correction
This commit is contained in:
Ilan Steemers
2015-09-26 13:13:25 +02:00
parent b8bb186471
commit 08104ef777
+1 -1
View File
@@ -27,7 +27,7 @@ class Mongo(Broker):
def get_collection(self):
if not Conf.MONGO_DB:
try:
Conf.MONGO_DB = self.connection.get_default_database()[1]
Conf.MONGO_DB = self.connection.get_default_database().name
except ConfigurationError:
Conf.MONGO_DB = 'django-q'
return self.connection[Conf.MONGO_DB][self.list_key]