From 01a82248382c556aaf167ee9c63e2a98ff57d214 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 9 Sep 2022 04:50:35 +0300 Subject: If port is null, use MySQL's default 3306 --- wqflask/wqflask/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wqflask') 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 -- cgit v1.2.3