aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-09-09 04:50:35 +0300
committerFrederick Muriuki Muriithi2022-09-09 04:50:35 +0300
commit01a82248382c556aaf167ee9c63e2a98ff57d214 (patch)
tree8ff4e5b4bee40f602a2769c941977544847ca3dd
parent9dd474141c968dd9b22bbb11f3b2af80b31aa530 (diff)
downloadgenenetwork2-01a82248382c556aaf167ee9c63e2a98ff57d214.tar.gz
If port is null, use MySQL's default 3306
-rw-r--r--wqflask/wqflask/database.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wqflask/wqflask/database.py b/wqflask/wqflask/database.py
index 2fd34078..b48f60ad 100644
--- a/wqflask/wqflask/database.py
+++ b/wqflask/wqflask/database.py
@@ -53,8 +53,8 @@ def database_connection() -> Iterator[Connection]:
"""
host, user, passwd, db_name, port = parse_db_url(sql_uri())
connection = MySQLdb.connect(
- db=db_name, user=user, passwd=passwd or '', host=host, port=port,
- autocommit=False # Required for roll-backs
+ db=db_name, user=user, passwd=passwd or '', host=host,
+ port=(port or 3306), autocommit=False # Required for roll-backs
)
try:
yield connection