File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ def check_django_compatability():
28
28
29
29
def parse (uri , ** kwargs ):
30
30
uri = parse_uri (uri )
31
+
31
32
host = None
32
33
port = None
33
34
@@ -37,20 +38,18 @@ def parse(uri, **kwargs):
37
38
else :
38
39
# If the fqdn is not present, this is a standard URI and the host and
39
40
# port are in the nodelist.
40
- host , port = [f"{ node [0 ]} :{ node [1 ]} " for node in uri ["nodelist" ]]. next (). split (":" )
41
+ host , port = [f"{ node [0 ]} :{ node [1 ]} " for node in uri ["nodelist" ]][ 0 ]. split (":" ) # noqa: RUF015
41
42
42
43
settings_dict = {
43
44
"ENGINE" : "django_mongodb" ,
44
45
"NAME" : uri ["database" ],
45
46
"HOST" : host ,
47
+ "PORT" : port ,
46
48
"USER" : uri .get ("username" ),
47
49
"PASSWORD" : uri .get ("password" ),
48
50
"OPTIONS" : uri .get ("options" ),
49
51
}
50
52
51
- if port :
52
- settings_dict ["PORT" ] = port
53
-
54
53
if kwargs :
55
54
settings_dict .update (kwargs )
56
55
You can’t perform that action at this time.
0 commit comments