Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crpellegrino committed Oct 3, 2024
1 parent 0676c63 commit 396ec6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_code/scripts/sync_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 396ec6e

Please sign in to comment.