diff --git a/authentik/root/install_id.py b/authentik/root/install_id.py index f0f319aa7c..e4f41cddff 100644 --- a/authentik/root/install_id.py +++ b/authentik/root/install_id.py @@ -7,7 +7,7 @@ from psycopg import connect from authentik.lib.config import CONFIG -QUERY = """SELECT id FROM public.authentik_install_id ORDER BY id LIMIT 1;""" +QUERY = """SELECT id FROM %s.authentik_install_id ORDER BY id LIMIT 1;""" @lru_cache @@ -20,7 +20,7 @@ def get_install_id() -> str: if settings.TEST: return str(uuid4()) with connection.cursor() as cursor: - cursor.execute(QUERY) + cursor.execute(QUERY, (CONFIG.get("postgresql.default_schema"))) return cursor.fetchone()[0] @@ -40,5 +40,5 @@ def get_install_id_raw(): sslkey=CONFIG.get("postgresql.sslkey"), ) cursor = conn.cursor() - cursor.execute(QUERY) + cursor.execute(QUERY, params=(CONFIG.get("postgresql.default_schema"))) return cursor.fetchone()[0]