From df7d2b1f21cd5521de33370d8d828e5ad2465e7d Mon Sep 17 00:00:00 2001
From: Daniel Neuwirth <daniel.neuwirth@dataport.de>
Date: Tue, 10 Dec 2019 09:20:12 +0000
Subject: [PATCH] slimed down enqueue

---
 ckanext/odsh/pdf_to_thumbnail/enqueue.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/ckanext/odsh/pdf_to_thumbnail/enqueue.py b/ckanext/odsh/pdf_to_thumbnail/enqueue.py
index 3dc7a1d5..0c25ad9b 100644
--- a/ckanext/odsh/pdf_to_thumbnail/enqueue.py
+++ b/ckanext/odsh/pdf_to_thumbnail/enqueue.py
@@ -22,14 +22,12 @@ def enqueue_after_update(context, resource):
     create_thumbnail_for_last_resource(resources, private, package_id)
 
 def enqueue_after_delete(context, resources):
-    if len(resources) > 0:
-        package = context.get('package')
-        private = package.private
-        package_id = package.id
-        first_resource = resources[0]
-        
-        # without the background job
-        create_thumbnail_for_last_resource(resources, private, package_id)
+    package = context.get('package')
+    private = package.private
+    package_id = package.id
+            
+    # without the background job
+    create_thumbnail_for_last_resource(resources, private, package_id)
         
 
 
-- 
GitLab