fix: select existing tenants by name in the operator portal
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
parent
3758a4bb5e
commit
d177d47975
8 changed files with 127 additions and 13 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue