fix revert situated at the wrong location
This commit is contained in:
parent
ccbd128fa2
commit
c0f1493473
@ -115,6 +115,8 @@ def get_connection(alias=DEFAULT_CONNECTION_NAME, reconnect=False):
|
||||
# Discard replicaSet if not base string
|
||||
if not isinstance(conn_settings['replicaSet'], basestring):
|
||||
conn_settings.pop('replicaSet', None)
|
||||
if pymongo.version_tuple[0] < 3:
|
||||
connection_class = MongoReplicaSetClient
|
||||
|
||||
try:
|
||||
connection = None
|
||||
@ -127,8 +129,6 @@ def get_connection(alias=DEFAULT_CONNECTION_NAME, reconnect=False):
|
||||
if conn_settings == connection_settings and _connections.get(db_alias, None):
|
||||
connection = _connections[db_alias]
|
||||
break
|
||||
if pymongo.version_tuple[0] < 3:
|
||||
connection_class = MongoReplicaSetClient
|
||||
|
||||
_connections[alias] = connection if connection else connection_class(**conn_settings)
|
||||
except Exception, e:
|
||||
|
Loading…
x
Reference in New Issue
Block a user