[ENG-9820]: cleanup and delete dead ES2 code#11688
Conversation
…NG-9822 [ENG-9822] - add required_metadata_template to API
…-consolidation [ENG-9829][ENG-9830] Add `should_index_for_search` field to CedarMetadataTemplate
…NG-9824 [ENG-9824] - Add required metadata validation
…NG-9825 Add switch to enforce required_metadata_template
…edar record existence
|
Clean, well-scoped deletion. One missed cleanup: |
…ature/ENG-9831 [ENG-9831] Cedar metadata record creation/deletion in share for collection submission
…2-develop-merge-conflicts Es2-develop merge conflicts
| def validate_required_metadata(self, osf_obj): | ||
| if not self.required_metadata_template: | ||
| return | ||
|
|
||
| record = CedarMetadataRecord.objects.filter( | ||
| guid__in=osf_obj.guids.all(), | ||
| template=self.required_metadata_template, | ||
| is_published=True, | ||
| ).first() | ||
|
|
||
| if record is None: | ||
| raise ValidationError( | ||
| f'Object must have a published CEDAR metadata record for the required template ' | ||
| f'"{self.required_metadata_template.schema_name}".' | ||
| ) | ||
|
|
||
| try: | ||
| jsonschema_validate(record.metadata, self.required_metadata_template.template) | ||
| except JsonSchemaValidationError as e: | ||
| raise ValidationError(e.message) | ||
|
|
There was a problem hiding this comment.
These seems to be new changes. Could you confirm whether this is needed?
There was a problem hiding this comment.
Ah, this is the method Vlad duplicated (I have already deleted it in another PR), so I assume es2 branch hasn't been merged into pbs yet, that's why this change is shown. Reverting it
| @@ -1 +1 @@ | |||
| /** | |||
There was a problem hiding this comment.
Do we still need this file?
There was a problem hiding this comment.
We have a lot of static files, so I removed those that use removed endpoints related to es2 project only. This one still uses api/v1/project// endpoint, so I decided to left it. When we start removing flask, this file will be removed anyway
3d79cca
into
CenterForOpenScience:feature/pbs-26-13

Ticket
https://openscience.atlassian.net/browse/ENG-9820
Purpose
After removing v1/v2 search endpoints, there is a lot of unused code that can be removed
Changes
Remove legacy code
IT IS HIGHLY RECOMMENDED TO REVIEW THIS PULL REQUEST COMMIT BY COMMIT