Fix empty db_url error message (#758)

This commit is contained in:
Kasun Herath 2023-04-03 04:05:29 +05:30 committed by GitHub
parent d955dc2a3c
commit 0e9c39d103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ def get_engine():
ValueError: If the database url is None. ValueError: If the database url is None.
""" """
url = get_config().db_url url = get_config().db_url
if url is None: if not url:
raise ValueError("No database url in config") raise ValueError("No database url in config")
return sqlmodel.create_engine(url, echo=False) return sqlmodel.create_engine(url, echo=False)