From 4c9992c49d34bade1b822d48a1b8971c94b6791f Mon Sep 17 00:00:00 2001 From: Benjamin Becker <benjamin.becker@dataport.de> Date: Thu, 16 Dec 2021 12:53:54 +0000 Subject: [PATCH] fixes bug of commit before this --- ckanext/odsh/collection/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/odsh/collection/helpers.py b/ckanext/odsh/collection/helpers.py index c4f4496f..4ef9cbcf 100644 --- a/ckanext/odsh/collection/helpers.py +++ b/ckanext/odsh/collection/helpers.py @@ -156,6 +156,6 @@ def get_latest_resources_for_format(collection_name, resource_format): return None resources_with_asked_type = [r for r in resources if r.get('format').upper() == resource_format.upper()] resources_sorted = sorted(resources_with_asked_type, key=itemgetter('id','created'), reverse=True) - if len(resources_sorted) == 1: + if len(resources_sorted) == 0: return None return resources_sorted[-1] -- GitLab