From 82d4e8aa4e398223fd2d40865feeb8eced0aa4d1 Mon Sep 17 00:00:00 2001 From: "Jens L." Date: Thu, 13 Feb 2025 01:25:13 +0100 Subject: [PATCH] root: use correct default schema for install_id (#13006) Signed-off-by: Jens Langhammer --- authentik/root/install_id.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]