fix: select existing tenants by name in the operator portal
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Container Image / build-and-push (push) Successful in 49s

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
tegwick 2026-09-12 00:51:57 +02:00
parent 3758a4bb5e
commit d177d47975
8 changed files with 127 additions and 13 deletions

View file

@ -157,6 +157,18 @@ class PostgresUserEngineStore:
self._query_records("memberships", tenant=tenant),
)
def membership_tenants(self) -> tuple[str, ...]:
with self._cursor() as cursor:
cursor.execute(
"SELECT DISTINCT tenant FROM user_engine_records "
"WHERE record_type = %s AND tenant IS NOT NULL ORDER BY tenant",
("memberships",),
)
return tuple(
str(row["tenant"] if isinstance(row, Mapping) else row[0])
for row in cursor.fetchall()
)
def save_application(self, application: Application) -> None:
self._upsert_record(application)