mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:17:08 +00:00
Include schema in returned survey configuration object
This commit is contained in:
@@ -627,12 +627,12 @@ class Datastore:
|
|||||||
|
|
||||||
if include_archived:
|
if include_archived:
|
||||||
qry = """
|
qry = """
|
||||||
SELECT meta
|
SELECT meta, schema
|
||||||
FROM public.projects;
|
FROM public.projects;
|
||||||
"""
|
"""
|
||||||
else:
|
else:
|
||||||
qry = """
|
qry = """
|
||||||
SELECT meta
|
SELECT meta, schema
|
||||||
FROM public.projects
|
FROM public.projects
|
||||||
WHERE NOT (meta->'archived')::boolean IS true
|
WHERE NOT (meta->'archived')::boolean IS true
|
||||||
"""
|
"""
|
||||||
@@ -642,7 +642,12 @@ class Datastore:
|
|||||||
|
|
||||||
cursor.execute(qry)
|
cursor.execute(qry)
|
||||||
results = cursor.fetchall()
|
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?
|
# TODO Does this need tweaking on account of #246?
|
||||||
|
|||||||
Reference in New Issue
Block a user