about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-07-14 11:24:12 -0500
committerFrederick Muriuki Muriithi2025-07-14 11:24:12 -0500
commit284f4b1141c9e13dfdbdf59699d73ddb3dcdf17b (patch)
tree1c42788eb7ab08ba6c0a050385d02f9c200478d2
parent252cf92a73168cd0a3310be10ee94ff55b30f407 (diff)
downloadgn-uploader-284f4b1141c9e13dfdbdf59699d73ddb3dcdf17b.tar.gz
Do not enter IDs in files in the description field.
-rw-r--r--uploader/phenotypes/models.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/uploader/phenotypes/models.py b/uploader/phenotypes/models.py
index 45fcd30..ed14993 100644
--- a/uploader/phenotypes/models.py
+++ b/uploader/phenotypes/models.py
@@ -320,16 +320,21 @@ def create_new_phenotypes(conn: mdb.Connection,
                  "Post_publication_abbreviation, Authorized_Users"
                  ")"
                  "VALUES (%s, %s, %s, %s, %s, %s, 'robwilliams')"),
-                tuple((row["id"], row["description"], row["description"], row["units"], row["id"], row["id"])
+                tuple((row["description"],
+                       row["description"],
+                       row["description"],
+                       row["units"],
+                       row["id"],
+                       row["id"])
                       for row in batch))
             paramstr = ", ".join(["%s"] * len(batch))
             cursor.execute(
-                "SELECT * FROM Phenotype WHERE Pre_publication_description IN "
+                "SELECT * FROM Phenotype WHERE Pre_publication_abbreviation IN "
                 f"({paramstr})",
                 tuple(item["id"] for item in batch))
             _phenos = _phenos + tuple({
                 "phenotype_id": row["Id"],
-                "id": row["Pre_publication_description"],
+                "id": row["Pre_publication_abbreviation"],
                 "description": row["Original_description"],
                 "units": row["Units"]
             } for row in cursor.fetchall())