Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
James Tessmer committed Oct 8, 2024
1 parent 1d1909a commit ee4f00a
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,12 @@ class SubmissionMetadata(Base):
metadata_submission = Column(JSONB, nullable=False)


class ContextForm(BaseModel):
awardDois: Optional[list[str]]
dataGenerated: Optional[bool]
facilityGenerated: Optional[bool]
facilities: list[str]
award: Optional[str]
otherAward: str
unknownDoi: Optional[bool]


def upgrade():
session = orm.Session(bind=op.get_bind())
mappings = []
for submission_metadata in session.query(SubmissionMetadata):
metadata_submission = submission_metadata.metadata_submission
context_form = metadata_submission("contextForm",{})
context_form = metadata_submission.get("contextForm")

if not context_form.get("awardDoi", None) and context_form.get("datasetDoi", None):
holder = context_form["datasetDoi"]
Expand All @@ -70,7 +60,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"]
Expand Down

0 comments on commit ee4f00a

Please sign in to comment.