File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 14
14
from .lookups import register_lookups # noqa: E402
15
15
from .query import register_nodes # noqa: E402
16
16
17
+ __all__ = ['parse' ]
18
+
17
19
register_aggregates ()
18
20
register_expressions ()
19
21
register_fields ()
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ def parse(uri):
31
31
port = None
32
32
33
33
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.
36
36
if "nodelist" in uri and isinstance (uri ["nodelist" ], list ) and len (uri ["nodelist" ]) > 0 :
37
37
first_node = uri ["nodelist" ][0 ]
38
38
if (
@@ -45,7 +45,7 @@ def parse(uri):
45
45
# The fqdn is not none so we need to add the mongodb+srv:// prefix to the host.
46
46
host = f"mongodb+srv://{ uri ['fqdn' ]} "
47
47
48
- url = {
48
+ settings_dict = {
49
49
"ENGINE" : "django_mongodb" ,
50
50
"NAME" : uri ["database" ],
51
51
"HOST" : host ,
@@ -54,9 +54,9 @@ def parse(uri):
54
54
}
55
55
56
56
if port :
57
- url ["PORT" ] = port
57
+ settings_dict ["PORT" ] = port
58
58
59
- return url
59
+ return settings_dict
60
60
61
61
62
62
def set_wrapped_methods (cls ):
You can’t perform that action at this time.
0 commit comments