Skip to content

Commit

Permalink
Made user info not required for RedisDSN. This will fix the issue pyd…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kesav Kolla authored and Kesav Kolla committed Mar 11, 2020
1 parent 184e8b6 commit 4ccb782
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pydantic/networks.py
Expand Up @@ -146,8 +146,9 @@ def build(
url = scheme + '://'
if user:
url += user
if password:
url += ':' + password
if password:
url += ':' + password
if user or password:
url += '@'
url += host
if port:
Expand Down
3 changes: 0 additions & 3 deletions tests/test_networks.py
Expand Up @@ -452,6 +452,3 @@ class Model(BaseModel):

assert str(Model(v=NameEmail('foo bar', 'foobaR@example.com')).v) == 'foo bar <foobaR@example.com>'
assert str(Model(v='foo bar <foobaR@example.com>').v) == 'foo bar <foobaR@example.com>'

if __name__ == '__main__':
test_redis_dsns()

0 comments on commit 4ccb782

Please sign in to comment.