From 1d1909a5ef4b337a1509b599673d9193d6ed6028 Mon Sep 17 00:00:00 2001 From: James Tessmer Date: Mon, 7 Oct 2024 19:41:09 -0700 Subject: [PATCH] update acces to contextForm again --- .../versions/988105f6581d_update_datasetDoi_to_awardDoi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nmdc_server/migrations/versions/988105f6581d_update_datasetDoi_to_awardDoi.py b/nmdc_server/migrations/versions/988105f6581d_update_datasetDoi_to_awardDoi.py index bb2db1da..aeba66e0 100644 --- a/nmdc_server/migrations/versions/988105f6581d_update_datasetDoi_to_awardDoi.py +++ b/nmdc_server/migrations/versions/988105f6581d_update_datasetDoi_to_awardDoi.py @@ -52,7 +52,7 @@ def upgrade(): mappings = [] for submission_metadata in session.query(SubmissionMetadata): metadata_submission = submission_metadata.metadata_submission - context_form = metadata_submission.get("contextForm") + context_form = metadata_submission("contextForm",{}) if not context_form.get("awardDoi", None) and context_form.get("datasetDoi", None): holder = context_form["datasetDoi"] @@ -70,7 +70,7 @@ def downgrade(): mappings = [] for submission_metadata in session.query(SubmissionMetadata): metadata_submission = submission_metadata.metadata_submission - context_form = metadata_submission.get("contextForm") + context_form = metadata_submission.get("contextForm",{}) if not context_form.get("datasetDoi", None) and context_form.get("awardDoi", None): holder = context_form["awardDoi"]