Skip to content

Commit 2c1b9ea

Browse files
committed
Revert "Remove workaround for mongo-orchestration 268"
This reverts commit e71a348.
1 parent e71a348 commit 2c1b9ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/mongodb_settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import os
22

3+
from pymongo.uri_parser import parse_uri
4+
35
if mongodb_uri := os.getenv("MONGODB_URI"):
46
db_settings = {
57
"ENGINE": "django_mongodb_backend",
68
"HOST": mongodb_uri,
79
}
10+
# Workaround for https://github.com/mongodb-labs/mongo-orchestration/issues/268
11+
uri = parse_uri(mongodb_uri)
12+
if uri.get("username") and uri.get("password"):
13+
db_settings["OPTIONS"] = {"tls": True, "tlsAllowInvalidCertificates": True}
814
DATABASES = {
915
"default": {**db_settings, "NAME": "djangotests"},
1016
"other": {**db_settings, "NAME": "djangotests-other"},

0 commit comments

Comments
 (0)