Skip to content

Commit

Permalink
Merge pull request #281 from dr-rodriguez/PublicationsName_change
Browse files Browse the repository at this point in the history
Changing references to Publications.c.name to use .c.publication
  • Loading branch information
kelle authored Aug 23, 2022
2 parents 35314ea + 311bf0d commit d8862bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/ingests/ingest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def ingest_sources(db, sources, references=None, ras=None, decs=None, comments=N
raise SimpleError(msg + msg2)
else:
continue
elif db.query(db.Publications).filter(db.Publications.c.name == references[i]).count() == 0:
elif db.query(db.Publications).filter(db.Publications.c.publication == references[i]).count() == 0:
# check if reference is in Publications table
msg = f"{i}: Skipping: {source}. Discovery reference {references[i]} is not in Publications table. \n" \
f"(Add it with add_publication function.) \n "
Expand Down Expand Up @@ -1018,7 +1018,7 @@ def ingest_spectra(db, sources, spectra, regimes, telescopes, instruments, modes
raise SimpleError(msg)
else:
continue
if db.query(db.Publications).filter(db.Publications.c.name == references[i]).count() == 0:
if db.query(db.Publications).filter(db.Publications.c.publication == references[i]).count() == 0:
msg = f"Spectrum for {source} could not be added to the database because the reference {references[i]} is not in Publications table. \n" \
f"(Add it with ingest_publication function.) \n "
logger.warning(msg)
Expand Down

0 comments on commit d8862bc

Please sign in to comment.