Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legacy: add parent doi link on records only #530

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion site/zenodo_rdm/legacy/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
RDMRecordService,
RDMRecordServiceConfig,
)
from invenio_rdm_records.services.config import has_doi, is_record_and_has_parent_doi
from invenio_rdm_records.services.config import has_doi
from invenio_records_resources.services import ConditionalLink
from invenio_records_resources.services.base.config import FromConfig
from invenio_records_resources.services.base.links import preprocess_vars
Expand All @@ -51,6 +51,11 @@ def is_published(record, ctx):
return record.is_published


def is_record_and_has_parent_doi(record, ctx):
"""Determine if record has parent doi."""
return is_record(record, ctx) and has_doi(record.parent, ctx)


class LegacyRecordLink(RecordLink):
"""Legacy record links with bucket information."""

Expand Down
Loading