Skip to content

Commit

Permalink
github: handle deleted record on release resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Oct 14, 2023
1 parent de3b205 commit 12b187f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion invenio_rdm_records/services/github/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."""
Expand Down

0 comments on commit 12b187f

Please sign in to comment.