Skip to content

[ENG-9827] - save collection-submission custom metadata to CedarMetadataRecord on create/update#11735

Open
Vlad0n20 wants to merge 1 commit into
CenterForOpenScience:feature/es2-consolidationfrom
Vlad0n20:feature/ENG-9827
Open

[ENG-9827] - save collection-submission custom metadata to CedarMetadataRecord on create/update#11735
Vlad0n20 wants to merge 1 commit into
CenterForOpenScience:feature/es2-consolidationfrom
Vlad0n20:feature/ENG-9827

Conversation

@Vlad0n20
Copy link
Copy Markdown
Contributor

@Vlad0n20 Vlad0n20 commented May 12, 2026

Ticket

Purpose

Changes

Side Effects

QE Notes

CE Notes

Documentation

Comment on lines -432 to -436
if waffle.switch_is_active(features.COLLECTION_SUBMISSION_WITH_CEDAR) and collection.provider_id:
try:
collection.provider.validate_required_metadata(guid.referent)
except ValidationError as e:
raise InvalidModelValueError(e.message)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about calling validate_required_metadata after sync_cedar_metadata, instead of removing the validation entirely? (looks like now it's never validated)

if not (self.collection.provider_id and self.collection.provider.required_metadata_template):
return
template = self.collection.provider.required_metadata_template
metadata = {f: getattr(self, f) for f in CEDAR_METADATA_FIELDS if getattr(self, f, '')}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main thing this has to do is make a valid cedar record (is why calling validate_required_metadata seems relevant) -- to index for search, will at least need a "@context" to be parsable as json-ld (either build one on the fly from the template jsonschema or hard-code one based on the specific properties used for the existing collection fields)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants