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 1414from .lookups import register_lookups # noqa: E402
1515from .query import register_nodes # noqa: E402
1616
17+ __all__ = ['parse' ]
18+
1719register_aggregates ()
1820register_expressions ()
1921register_fields ()
Original file line number Diff line number Diff 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
6262def set_wrapped_methods (cls ):
You can’t perform that action at this time.
0 commit comments