Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect blindly overrides username/password when URI style connection is used. #909

Closed
ryan-lane opened this issue Mar 18, 2015 · 2 comments

Comments

@ryan-lane
Copy link

mongoengine.register_connection(
    'myalias',
    'mydb',
    host='mongodb://localhost:27017',
    username='myuser',
    password=='mypassword'
)

The above will connect to mydb with username None and password None. This is because though a username and password are set, if a uri is used mongoengine will blindly override them: https://github.com/MongoEngine/mongoengine/blob/master/mongoengine/connection.py#L57

Is there any reason not to do 'or username' and 'or password' similar to what's being done for database?

@MRigal MRigal added the Bug label Apr 29, 2015
@MRigal
Copy link
Member

MRigal commented Apr 29, 2015

This is a known bug. The PR #731 almost fixed it, but was never finished. If you feel like helping on the topic, you may complete it, or create a new PR starting from scratch.

@wojcikstefan
Copy link
Member

This was fixed by #1428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants