root: use correct default schema for install_id (#13006)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L.
2025-02-13 01:25:13 +01:00
committed by GitHub
parent 98129d3e9a
commit 82d4e8aa4e

View File

@ -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]