Skip to content

Commit b1174b7

Browse files
committed
Renamed default connection alias.
1 parent ee3cce3 commit b1174b7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

flask_mongoengine/connection.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'InvalidSettingsError', 'get_db'
1414
)
1515

16-
DEFAULT_CONNECTION_NAME = 'default-mongodb-sandbox'
16+
DEFAULT_CONNECTION_NAME = 'default-mongodb-connection'
1717

1818
_connection_settings = {}
1919
_connections = {}
@@ -239,6 +239,7 @@ def _register_test_connection(port, db_alias, preserved):
239239
return _conn
240240

241241
def _resolve_settings(conn_setting, removePass=True):
242+
242243
if conn_setting and isinstance(conn_setting, dict):
243244
read_preference = False
244245
alias = conn_setting.get('MONGODB_ALIAS',
@@ -249,10 +250,6 @@ def _resolve_settings(conn_setting, removePass=True):
249250
username = conn_setting.get('MONGODB_USERNAME', conn_setting.get('username', None))
250251
password = conn_setting.get('MONGODB_PASSWORD', conn_setting.get('password', None))
251252

252-
if (not current_app.config.get('TESTING', False)
253-
and alias == DEFAULT_CONNECTION_NAME):
254-
alias = "{0}_{1}".format(db, port)
255-
256253
if IS_PYMONGO_3:
257254
read_preference = ReadPreference.PRIMARY
258255

0 commit comments

Comments
 (0)