inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 84 forks source link

access-requests: handle failure of creation of (user/guest) access requests #1361

Closed zzacharo closed 1 year ago

zzacharo commented 1 year ago

When creating new access requests, we perform the "submit" action immediately after the request was created successfully. If there was any error in the request creation, we return the (created, but unsubmitted) request early. However, there's no strong indication that there have been errors (other than the .errors field being set?). We should check that, and maybe raise an exception (with the created/unsubmitted request as payload).

kpsherva commented 1 year ago

check https://github.com/inveniosoftware/invenio-rdm-records/pull/1410/files#diff-f1ba3f9be59bb3905cbc2e8d700d43e2a22281ff63f9dd08b79b99e07ce26c45L738

I have tested it and the errors there were caused by missing required field on creation, which I also fixed here

https://github.com/inveniosoftware/invenio-rdm-records/pull/1410/files#diff-f1ba3f9be59bb3905cbc2e8d700d43e2a22281ff63f9dd08b79b99e07ce26c45R715