Skip to content

Commit 0150b53

Browse files
committed
fix picking a default DB if mongo URI w/o the db name was provided
1 parent 3ba447a commit 0150b53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flask_mongoengine/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _sanitize_settings(settings):
2828
resolved_settings['db'] = uri_dict['database']
2929

3030
# Add a default name param or use the "db" key if exists
31-
if 'db' in resolved_settings:
31+
if resolved_settings.get('db'):
3232
resolved_settings['name'] = resolved_settings.pop('db')
3333
else:
3434
resolved_settings['name'] = 'test'

0 commit comments

Comments
 (0)