diff options
author | Frederick Muriuki Muriithi | 2022-09-09 04:50:35 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-09-09 04:50:35 +0300 |
commit | 01a82248382c556aaf167ee9c63e2a98ff57d214 (patch) | |
tree | 8ff4e5b4bee40f602a2769c941977544847ca3dd /wqflask | |
parent | 9dd474141c968dd9b22bbb11f3b2af80b31aa530 (diff) | |
download | genenetwork2-01a82248382c556aaf167ee9c63e2a98ff57d214.tar.gz |
If port is null, use MySQL's default 3306
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/database.py | 4 |
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 |