Skip to content

Commit

Permalink
fix tombstone page
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova authored and kpsherva committed May 27, 2024
1 parent 09c8d76 commit f4ada38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions invenio_app_rdm/records_ui/views/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,16 @@ def record_permission_denied_error(error):

record = getattr(error, "record", None)

is_restricted = record.get("access", {}).get("record", None) == "restricted"
has_doi = "doi" in record.get("pids", {})
if record and is_restricted and has_doi:
return (
render_template(
"invenio_app_rdm/records/restricted_tombstone.html",
record=record,
),
403,
)
if record:
is_restricted = record.get("access", {}).get("record", None) == "restricted"
has_doi = "doi" in record.get("pids", {})
if is_restricted and has_doi:
return (
render_template(
"invenio_app_rdm/records/restricted_with_doi_tombstone.html",
record=record,
),
403,
)

return render_template(current_app.config["THEME_403_TEMPLATE"]), 403

0 comments on commit f4ada38

Please sign in to comment.