We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0484032 commit 58cdeb0Copy full SHA for 58cdeb0
django_mongodb/utils.py
@@ -36,10 +36,11 @@ def parse(uri, **kwargs):
36
# If the fqdn is present, this is a SRV URI and the host is the fqdn.
37
host = f"mongodb+srv://{uri['fqdn']}"
38
else:
39
- if len(uri("nodelist")) == 1:
40
- host, port = uri("nodelist")[0].split(":")
41
- elif len(uri("nodelist")) > 1:
42
- host = ",".join(uri["nodelist"])
+ nodelist = uri.get("nodelist")
+ if len(nodelist) == 1:
+ host, port = nodelist[0].split(":")
+ elif len(nodelist) > 1:
43
+ host = ",".join([f"{host}:{port}" for host, port in nodelist])
44
45
settings_dict = {
46
"ENGINE": "django_mongodb",
0 commit comments