diff --git a/djongo/base.py b/djongo/base.py index ba6766d7..7a1d5165 100644 --- a/djongo/base.py +++ b/djongo/base.py @@ -169,9 +169,6 @@ def get_new_connection(self, connection_params): # To prevent leaving unclosed connections behind, # client_conn must be closed before a new connection # is created. - if self.client_connection is not None: - self.client_connection.close() - logger.debug('Existing MongoClient connection closed') self.client_connection = Database.connect(db=name, **connection_params) logger.debug('New Database connection') diff --git a/djongo/database.py b/djongo/database.py index 79ecf283..15d01cd1 100644 --- a/djongo/database.py +++ b/djongo/database.py @@ -9,7 +9,7 @@ def connect(db, **kwargs): logger.debug('New MongoClient connection') - clients[db] = MongoClient(**kwargs, connect=False) + clients[db] = MongoClient(**kwargs, connect=True) return clients[db] diff --git a/requirements.txt b/requirements.txt index cb8a4ea4..e3312679 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # THIS FILE WAS CHANGED ON - 19 Aug 2022 -sqlparse==0.4.4 +sqlparse~=0.5.0 pymongo>=3.6.0,<4.0 django>=3.2 # requirements.txt diff --git a/setup.py b/setup.py index 41d0157f..292fa5e3 100644 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ def find_version(*file_paths): install_requires = [ - 'sqlparse==0.4.4', + 'sqlparse~=0.5.0', 'pymongo>=3.6.0', 'django>=3.2', ]