Skip to content

Commit 38e2c23

Browse files
fenekkumax-moser
authored andcommitted
file_links: prepare for changes in invenio-records-resources [+]
Invenio-records-resources will not provide default `file_links_{item,search}` values, because with the usage of `invenio_url_for` those default values cannot be generic anymore. Links need a specific endpoint which the default config cannot provide (doesn't provide a blueprint for starters). So to prevent breakage when invenio-records-resources is released and invenio-rdm-records uses it before its own code has been changed, we need to make the pre-emptive change in this PR.
1 parent a339cfa commit 38e2c23

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

invenio_rdm_records/services/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
33
# Copyright (C) 2020-2024 CERN.
4-
# Copyright (C) 2020-2021 Northwestern University.
4+
# Copyright (C) 2020-2025 Northwestern University.
55
# Copyright (C) 2021 TU Wien.
66
# Copyright (C) 2021-2023 Graz University of Technology.
77
# Copyright (C) 2022 Universität Hamburg
@@ -313,15 +313,16 @@ class RDMFileRecordServiceConfig(FileServiceConfig, ConfiguratorMixin):
313313
max_files_count = FromConfig("RDM_RECORDS_MAX_FILES_COUNT", 100)
314314

315315
file_links_list = {
316-
**FileServiceConfig.file_links_list,
316+
"self": RecordLink("{+api}/records/{id}/files"),
317317
"archive": RecordLink(
318318
"{+api}/records/{id}/files-archive",
319319
when=archive_download_enabled,
320320
),
321321
}
322322

323323
file_links_item = {
324-
**FileServiceConfig.file_links_item,
324+
"self": FileLink("{+api}/records/{id}/files/{+key}"),
325+
"content": FileLink("{+api}/records/{id}/files/{+key}/content"),
325326
# FIXME: filename instead
326327
"iiif_canvas": FileLink(
327328
"{+api}/iiif/record:{id}/canvas/{key}", when=is_iiif_compatible

0 commit comments

Comments
 (0)