about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzsloan <zachary.a.sloan@gmail.com>2026-07-31 21:45:12 +0000
committerzsloan <zachary.a.sloan@gmail.com>2026-10-06 19:49:55 +0000
commitb3bbd8904a305a6954b3524823944bab0be2dad5 (patch)
treece799c2ae79ea7761ee3def60ea524172e1927c4
parent566b7c205457fbe9945f702290938de15056814b (diff)
downloadgenenetwork3-b3bbd8904a305a6954b3524823944bab0be2dad5.tar.gz
bug: Fix bug where any edits to a trait with no values were wrongly being intercepted
-rw-r--r--gn3/db/sample_data.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gn3/db/sample_data.py b/gn3/db/sample_data.py
index 57036a1..8d915c0 100644
--- a/gn3/db/sample_data.py
+++ b/gn3/db/sample_data.py
@@ -115,7 +115,10 @@ FROM ProbeSetFreeze psf
 WHERE ps.Id = %s AND psf.Name= %s""", (probeset_id, dataset_name))
 
         if not (data := cursor.fetchall()):
-            return "No Sample Data Found"
+            trait_csv = ["Strain Name,Value,SE,Count"]
+            for sample in sample_list:
+                trait_csv.append(f"{sample},x,x,x")
+            return "\n".join(trait_csv)
 
         # Get list of samples with data in the DB
         existing_samples = [el[0] for el in data]
@@ -179,7 +182,10 @@ FROM PublishFreeze pf JOIN PublishXRef px ON px.InbredSetId = pf.InbredSetId
 WHERE px.Id = %s AND px.InbredSetId = %s ORDER BY st.Name""",
                        (trait_name, group_id))
         if not (data := cursor.fetchall()):
-            return "No Sample Data Found"
+            trait_csv = ["Strain Name,Value,SE,Count"]
+            for sample in sample_list:
+                trait_csv.append(f"{sample},x,x,x")
+            return "\n".join(trait_csv)
 
         # Get list of samples with data in the DB
         existing_samples = [el[0] for el in data]