Skip to content

Commit

Permalink
dashboard: fix user request details page
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Oct 23, 2023
1 parent 3ccffdc commit 28ded04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion invenio_app_rdm/requests_ui/views/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from flask_login import current_user, login_required
from invenio_communities.members.services.request import CommunityInvitation
from invenio_communities.views.decorators import pass_community
from invenio_pidstore.errors import PIDDoesNotExistError
from invenio_rdm_records.proxies import current_rdm_records_service
from invenio_rdm_records.requests import CommunityInclusion, CommunitySubmission
from invenio_rdm_records.resources.serializers import UIJSONSerializer
Expand Down Expand Up @@ -51,7 +52,12 @@ def _resolve_topic_record(request):
try:
# read draft
record = current_rdm_records_service.read_draft(g.identity, pid, expand=True)
except NoResultFound:
except (NoResultFound, PIDDoesNotExistError):
# We catch PIDDoesNotExistError because a published record with
# a soft-deleted draft will raise this error. The lines below
# will catch the case that a id does not exists and raise a
# PIDDoesNotExistError that can be handled as 404 in the resource
# layer.
try:
# read published record
record = current_rdm_records_service.read(g.identity, pid, expand=True)
Expand Down

0 comments on commit 28ded04

Please sign in to comment.