From 522237820cc15a6b6ca98abdbff090889ea158a1 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Wed, 3 Apr 2013 08:56:38 +0200 Subject: Don't try to authenticate is no password is given by the user in the configuration file. --- source/mongodb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/mongodb.py b/source/mongodb.py index b8ac0fd9..23a5b5ad 100644 --- a/source/mongodb.py +++ b/source/mongodb.py @@ -38,7 +38,8 @@ class Articles(object): self.db_name = db_name self.connection = pymongo.connection.Connection(url, port) self.db = pymongo.database.Database(self.connection, self.db_name) - self.db.authenticate(user, password) + if password != "": + self.db.authenticate(user, password) collections = self.db.collection_names() for collection_name in collections: if collection_name != "system.indexes": -- cgit