From de5aa0645cb870f728bb24ed095f28465012eb24 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 4 Oct 2022 17:53:54 +0000 Subject: Initialize result_list for /traits endpoint JSON output --- wqflask/wqflask/api/router.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py index 3a7dee77..41901159 100644 --- a/wqflask/wqflask/api/router.py +++ b/wqflask/wqflask/api/router.py @@ -440,6 +440,7 @@ def fetch_traits(dataset_name, file_format="json"): if file_format == "json": filename = dataset_name + "_traits.json" cursor.execute(query.format(dataset_id)) + result_list = [] for result in cursor.fetchall(): trait_dict = {} for i, field in enumerate(field_list): -- cgit v1.2.3