Skip to content

Commit f4ada38

Browse files
anikachurilovakpsherva
authored andcommitted
fix tombstone page
1 parent 09c8d76 commit f4ada38

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

invenio_app_rdm/records_ui/views/records.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,16 @@ def record_permission_denied_error(error):
419419

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

422-
is_restricted = record.get("access", {}).get("record", None) == "restricted"
423-
has_doi = "doi" in record.get("pids", {})
424-
if record and is_restricted and has_doi:
425-
return (
426-
render_template(
427-
"invenio_app_rdm/records/restricted_tombstone.html",
428-
record=record,
429-
),
430-
403,
431-
)
422+
if record:
423+
is_restricted = record.get("access", {}).get("record", None) == "restricted"
424+
has_doi = "doi" in record.get("pids", {})
425+
if is_restricted and has_doi:
426+
return (
427+
render_template(
428+
"invenio_app_rdm/records/restricted_with_doi_tombstone.html",
429+
record=record,
430+
),
431+
403,
432+
)
432433

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

0 commit comments

Comments
 (0)