From 2b5e7af5b4b7bd482b661e30a504467cd4e44b28 Mon Sep 17 00:00:00 2001
From: Vermaas <vermaas@astron.nl>
Date: Thu, 22 Feb 2024 14:43:17 +0100
Subject: [PATCH] fix test (and potential bug)

---
 atdb/taskdatabase/models.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/atdb/taskdatabase/models.py b/atdb/taskdatabase/models.py
index 24ebb6e2..5f6e51cc 100644
--- a/atdb/taskdatabase/models.py
+++ b/atdb/taskdatabase/models.py
@@ -149,11 +149,15 @@ def check_if_summary(task):
     for backward compatiblity reasons this is done very ugly, by looking if certain filenames contain the substring 'summary'
     """
     # look in the outputs.tar_archive
-    tars = task.outputs['tar_archive']
-    for tar in tars:
-        if 'summary' in tar['basename']:
-            # a summary tarball was found, this task is a summary task
-            return True
+    try:
+        tars = task.outputs['tar_archive']
+        for tar in tars:
+            if 'summary' in tar['basename']:
+                # a summary tarball was found, this task is a summary task
+                return True
+    except:
+        # no 'tar_archive' was found
+        return False
 
     return False
 
-- 
GitLab