update changelog
This commit is contained in:
parent
84c42ed58c
commit
36aebffcc0
@ -13,6 +13,7 @@ Development
|
||||
- expose `mongoengine.connection.disconnect` and `mongoengine.connection.disconnect_all`
|
||||
- Fix disconnect function #566 #1599 #605 #607 #1213 #565
|
||||
- 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)
|
||||
- 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`
|
||||
|
@ -270,9 +270,9 @@ def get_connection(alias=DEFAULT_CONNECTION_NAME, reconnect=False):
|
||||
if existing_connection:
|
||||
_connections[alias] = existing_connection
|
||||
else:
|
||||
_create_connection(alias=alias,
|
||||
connection_class=connection_class,
|
||||
**conn_settings)
|
||||
_connections[alias] = _create_connection(alias=alias,
|
||||
connection_class=connection_class,
|
||||
**conn_settings)
|
||||
|
||||
return _connections[alias]
|
||||
|
||||
@ -283,7 +283,7 @@ def _create_connection(alias, connection_class, **connection_settings):
|
||||
MongoEngineConnectionError if it can't be established.
|
||||
"""
|
||||
try:
|
||||
_connections[alias] = connection_class(**connection_settings)
|
||||
return connection_class(**connection_settings)
|
||||
except Exception as e:
|
||||
raise MongoEngineConnectionError(
|
||||
'Cannot connect to database %s :\n%s' % (alias, e))
|
||||
|
Loading…
x
Reference in New Issue
Block a user