From 86b81be8c67cf82e8f26a7f84cbdc5df7198e214 Mon Sep 17 00:00:00 2001 From: John Nduli Date: Fri, 18 Oct 2024 15:06:36 +0300 Subject: refactor: replace gn3.auth.db with gn3.sqlite_db_utils and drop all refs to gn3.auth --- gn3/auth/db_utils.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 gn3/auth/db_utils.py (limited to 'gn3/auth/db_utils.py') diff --git a/gn3/auth/db_utils.py b/gn3/auth/db_utils.py deleted file mode 100644 index c06b026..0000000 --- a/gn3/auth/db_utils.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Some common auth db utilities""" -from typing import Any, Callable -from flask import current_app - -from . import db - -def with_db_connection(func: Callable[[db.DbConnection], Any]) -> Any: - """ - Takes a function of one argument `func`, whose one argument is a database - connection. - """ - db_uri = current_app.config["AUTH_DB"] - with db.connection(db_uri) as conn: - return func(conn) -- cgit 1.4.1