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