From 284f4b1141c9e13dfdbdf59699d73ddb3dcdf17b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 14 Jul 2025 11:24:12 -0500 Subject: Do not enter IDs in files in the description field. --- uploader/phenotypes/models.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'uploader') 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()) -- cgit v1.2.3