Skip to content

Commit

Permalink
Fix check_doi command
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Apr 10, 2024
1 parent 2afe0a9 commit ec634f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions isimip_publisher/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ec634f1

Please sign in to comment.