osf.io
osf.io copied to clipboard
[ENG-1312] Raise Errors for Invalid Registration Metadata upon Registration Creation
Purpose
Disallows registrations with invalid metadata to be created by raising an exception.
Analysis
Based off of the following PR (https://github.com/CenterForOpenScience/osf.io/commit/f04adf076fc4bb744a357c24322c703cf21dc173), it looks like originally an exception was being raised in addition to being logged to sentry if validate_metadata being called by create of the RegistrationCreateSerializer. This was changed with the intention of being a temporary change until JSON schemas for registrations were updated but the temporary change was never reverted. Simply reverting the changes in the PR should re-enforce validation by raising exceptions as they were previously.
Changes
- If
validate_metadata
results in an exception, the RegistrationCreation serializer will raise an error instead of logging the exception to sentry and continuing with the creation process.
QA Notes
- Validate that invalid registration metadata is not permitted in the registration creation process via the API
Documentation
N/A
Side Effects
N/A