update changelog

This commit is contained in:
Bastien Gérard 2019-06-04 22:39:44 +02:00
parent 84c42ed58c
commit 36aebffcc0
2 changed files with 5 additions and 4 deletions

View File

@ -13,6 +13,7 @@ Development
- expose `mongoengine.connection.disconnect` and `mongoengine.connection.disconnect_all` - expose `mongoengine.connection.disconnect` and `mongoengine.connection.disconnect_all`
- Fix disconnect function #566 #1599 #605 #607 #1213 #565 - Fix disconnect function #566 #1599 #605 #607 #1213 #565
- Improve connect/disconnect documentations - Improve connect/disconnect documentations
- Fix issue when using multiple connections to the same mongo with different credentials #2047
- POTENTIAL BREAKING CHANGES: (associated with connect/disconnect fixes) - POTENTIAL BREAKING CHANGES: (associated with connect/disconnect fixes)
- calling `connect` 2 times with the same alias and different parameter will raise an error (should call disconnect first) - calling `connect` 2 times with the same alias and different parameter will raise an error (should call disconnect first)
- disconnect now clears `mongoengine.connection._connection_settings` - disconnect now clears `mongoengine.connection._connection_settings`

View File

@ -270,9 +270,9 @@ def get_connection(alias=DEFAULT_CONNECTION_NAME, reconnect=False):
if existing_connection: if existing_connection:
_connections[alias] = existing_connection _connections[alias] = existing_connection
else: else:
_create_connection(alias=alias, _connections[alias] = _create_connection(alias=alias,
connection_class=connection_class, connection_class=connection_class,
**conn_settings) **conn_settings)
return _connections[alias] return _connections[alias]
@ -283,7 +283,7 @@ def _create_connection(alias, connection_class, **connection_settings):
MongoEngineConnectionError if it can't be established. MongoEngineConnectionError if it can't be established.
""" """
try: try:
_connections[alias] = connection_class(**connection_settings) return connection_class(**connection_settings)
except Exception as e: except Exception as e:
raise MongoEngineConnectionError( raise MongoEngineConnectionError(
'Cannot connect to database %s :\n%s' % (alias, e)) 'Cannot connect to database %s :\n%s' % (alias, e))