diff --git a/invenio_rdm_records/services/github/release.py b/invenio_rdm_records/services/github/release.py index 65aae72d0..7855062a6 100644 --- a/invenio_rdm_records/services/github/release.py +++ b/invenio_rdm_records/services/github/release.py @@ -13,6 +13,7 @@ from invenio_github.models import ReleaseStatus from invenio_records_resources.services.uow import UnitOfWork +from ..errors import RecordDeletedException from ...proxies import current_rdm_records_service from ...resources.serializers.ui import UIJSONSerializer from .metadata import RDMReleaseMetadata @@ -35,7 +36,10 @@ def resolve_record(self): if not self.release_object.record_id: return None recid = retrieve_recid_by_uuid(self.release_object.record_id) - return current_rdm_records_service.read(system_identity, recid.pid_value) + try: + return current_rdm_records_service.read(system_identity, recid.pid_value) + except RecordDeletedException: + return None def _upload_files_to_draft(self, draft, draft_file_service, uow): """Upload files to draft."""