Include schema in returned survey configuration object

This commit is contained in:
D. Berge
2024-04-30 13:25:40 +02:00
parent c20b3b64c7
commit 934b921f69

View File

@@ -627,12 +627,12 @@ class Datastore:
if include_archived:
qry = """
SELECT meta
SELECT meta, schema
FROM public.projects;
"""
else:
qry = """
SELECT meta
SELECT meta, schema
FROM public.projects
WHERE NOT (meta->'archived')::boolean IS true
"""
@@ -642,7 +642,12 @@ class Datastore:
cursor.execute(qry)
results = cursor.fetchall()
return [r[0] for r in results if r[0]]
surveys = []
for r in results:
if r[0]:
r[0]['schema'] = r[1]
surveys.append(r[0])
return surveys
# TODO Does this need tweaking on account of #246?