Skip to content

Commit 7f63347

Browse files
committed
fixes
1 parent 53c0a13 commit 7f63347

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

django_mongodb/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from .lookups import register_lookups # noqa: E402
1515
from .query import register_nodes # noqa: E402
1616

17+
__all__ = ['parse']
18+
1719
register_aggregates()
1820
register_expressions()
1921
register_fields()

django_mongodb/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def parse(uri):
3131
port = None
3232

3333
if uri["fqdn"] is None:
34-
# If fqdn is None then this is not a SRV URI, so we need to extract the
35-
# port from the first node in the nodelist.
34+
# If fqdn is None this is not a SRV URI so extract port from the first
35+
# node in nodelist.
3636
if "nodelist" in uri and isinstance(uri["nodelist"], list) and len(uri["nodelist"]) > 0:
3737
first_node = uri["nodelist"][0]
3838
if (
@@ -45,7 +45,7 @@ def parse(uri):
4545
# The fqdn is not none so we need to add the mongodb+srv:// prefix to the host.
4646
host = f"mongodb+srv://{uri['fqdn']}"
4747

48-
url = {
48+
settings_dict = {
4949
"ENGINE": "django_mongodb",
5050
"NAME": uri["database"],
5151
"HOST": host,
@@ -54,9 +54,9 @@ def parse(uri):
5454
}
5555

5656
if port:
57-
url["PORT"] = port
57+
settings_dict["PORT"] = port
5858

59-
return url
59+
return settings_dict
6060

6161

6262
def set_wrapped_methods(cls):

0 commit comments

Comments
 (0)