From 396ec6e018ff68e93ff220d71fc3111bf12b2499 Mon Sep 17 00:00:00 2001 From: Craig Pellegrino Date: Thu, 3 Oct 2024 14:54:50 -0400 Subject: [PATCH] Bug fix --- custom_code/scripts/sync_databases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_code/scripts/sync_databases.py b/custom_code/scripts/sync_databases.py index 4cc6999..bae8a12 100755 --- a/custom_code/scripts/sync_databases.py +++ b/custom_code/scripts/sync_databases.py @@ -342,10 +342,10 @@ def update_spec(action, db_address=_SNEX2_DB): snex2_id = value.get('snex2_id', '') spec = db_session.query(Datum).filter(and_(Datum.data_type=='spectroscopy', Datum.id==snex2_id)).first() if not spec.data_product_id: - spec.delete() + db_session.delete(spec) else: # Delete the associated DataProduct with the spectrum data_product_id = spec.data_product_id - spec.delete() + db_session.delete(spec) db_session.query(Data_Product).filter(Data_Product.id == data_product_id).delete() break