about summary refs log tree commit diff
path: root/qc_app
diff options
context:
space:
mode:
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/db/populations.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/qc_app/db/populations.py b/qc_app/db/populations.py
index 48ead2e..4485e52 100644
--- a/qc_app/db/populations.py
+++ b/qc_app/db/populations.py
@@ -31,18 +31,20 @@ def save_population(conn: mdb.Connection, population_details: dict) -> dict:
     with conn.cursor(cursorclass=DictCursor) as cursor:
         cursor.execute(
             "INSERT INTO InbredSet("
-            "InbredSetName, Name, SpeciesId, FullName, MenuOrderId, Description"
+            "InbredSetId, InbredSetName, Name, SpeciesId, FullName, "
+            "MenuOrderId, Description"
             ") "
             "VALUES ("
-            "%(InbredSetName)s, %(Name)s, %(SpeciesId)s, %(FullName)s, "
-            "%(MenuOrderId)s, %(Description)s"
+            "%(InbredSetId)s, %(InbredSetName)s, %(Name)s, %(SpeciesId)s, "
+            "%(FullName)s, %(MenuOrderId)s, %(Description)s"
             ")",
             {
                 "MenuOrderId": 0,
+                "InbredSetId": 0,
                 **population_details
             })
         new_id = cursor.lastrowid
-        cursor.execute("UPDATE InbredSet SET InbredSetId=%s WHERE Id=%s"
+        cursor.execute("UPDATE InbredSet SET InbredSetId=%s WHERE Id=%s",
                        (new_id, new_id))
         return {
             **population_details,