From ec634f10c77fe7e0454c048bd1ba0354b8c17979 Mon Sep 17 00:00:00 2001 From: Jochen Klar Date: Wed, 10 Apr 2024 16:43:41 +0200 Subject: [PATCH] Fix check_doi command --- isimip_publisher/commands.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/isimip_publisher/commands.py b/isimip_publisher/commands.py index 365731e..f60e176 100644 --- a/isimip_publisher/commands.py +++ b/isimip_publisher/commands.py @@ -453,12 +453,14 @@ def register_doi(): def check_doi(): session = database.init_database_session(settings.DATABASE) - datasets = database.retrieve_datasets(session, settings.PATH, public=(not settings.ARCHIVED), like=True) + datasets = database.retrieve_datasets(session, settings.PATH, + public=(not settings.ARCHIVED), like=True, follow=True) if not datasets: raise RuntimeError(f'no dataset found for {settings.PATH}') for dataset in datasets: - if not dataset.resources: + if not dataset.resources or \ + not any(settings.PATH.startswith(path) for resource in dataset.resources for path in resource.paths): for file in dataset.files: print(file.path)