aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn3/db/sample_data.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gn3/db/sample_data.py b/gn3/db/sample_data.py
index a3a6ded..140e62e 100644
--- a/gn3/db/sample_data.py
+++ b/gn3/db/sample_data.py
@@ -407,10 +407,9 @@ def insert_sample_data(
cursor.execute(
"SELECT Id FROM PublishData where Id = %s "
"AND StrainId = %s",
- (data_id, strain_id),
- )
- conn.commit()
- if cursor.fetchone(): # Data already exists
+ (data_id, strain_id))
+ data_exists = cursor.fetchone()
+ if data_exists: # Data already exists
return count
for header, value in zip(csv_header.split(","), data.split(",")):