From 8a1ca0510e3c0fa19fe3088adb0d4cdc30ce45d6 Mon Sep 17 00:00:00 2001
From: Vermaas <vermaas@astron.nl>
Date: Mon, 15 Jan 2024 17:09:03 +0100
Subject: [PATCH] bugfix: show SAS_ID (output)

---
 atdb/taskdatabase/models.py | 7 +++++--
 atdb/taskdatabase/views.py  | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/atdb/taskdatabase/models.py b/atdb/taskdatabase/models.py
index dc641500..bd3fb485 100644
--- a/atdb/taskdatabase/models.py
+++ b/atdb/taskdatabase/models.py
@@ -295,8 +295,11 @@ class Task(models.Model):
         """
         try:
             for task in Task.objects.filter(sas_id=self.sas_id):
-                if task.archive['sas_id_archived']:
-                    return task.archive['sas_id_archived']
+                try:
+                    if task.archive['sas_id_archived']:
+                        return task.archive['sas_id_archived']
+                except:
+                    pass
         except:
             return None
 
diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py
index b54b8e71..e7c21a20 100644
--- a/atdb/taskdatabase/views.py
+++ b/atdb/taskdatabase/views.py
@@ -553,6 +553,7 @@ def get_filtered_tasks(request, pre_filtered_tasks=None, distinct=None):
     # check filtered_tasks on the session
     # if it is at its max limit, then this is not a query targeted at 1 SAS_ID.
     # in that case don't apply the filter, so that all SAS_ID's show up on the page.
+    # nv: 15jan2024, Vlad didn't like this new behaviour
     try:
         filtered_tasks_on_session = len(request.session['filtered_tasks_as_list'])
         if filtered_tasks_on_session != settings.QUERY_LIMIT_MULTI_CHANGE:
-- 
GitLab