diff --git a/core/diyanetdb.py b/core/diyanetdb.py index e56ad1d..04939ef 100644 --- a/core/diyanetdb.py +++ b/core/diyanetdb.py @@ -25,7 +25,7 @@ def get_connection() -> sqlite3.Connection: d[col[0]] = row[idx] return d - conn = sqlite3.connect(config.DB_PATH) + conn = sqlite3.connect(config.DB_PATH, check_same_thread=False) conn.row_factory = dict_factory yield conn conn.close() @@ -58,7 +58,7 @@ def save_locations(conn: sqlite3.Connection, locations: List[dict]): def find_locations(conn: sqlite3.Connection, *, country: str, - city: str = '') -> List[Location]: + city: str = None) -> List[Location]: sql = ''' SELECT DISTINCT id, country, city, region FROM locations