From 901042ae9687c290d9def7b50a6247f63227d73c Mon Sep 17 00:00:00 2001 From: danfunk Date: Wed, 7 Jun 2023 15:02:32 -0400 Subject: [PATCH] Trying to resolve an error with the task log. --- crc/api/admin.py | 3 +++ crc/models/task_log.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crc/api/admin.py b/crc/api/admin.py index fccef37e..b2147bb8 100644 --- a/crc/api/admin.py +++ b/crc/api/admin.py @@ -47,6 +47,9 @@ class StudyView(AdminModelView): can_create = True can_edit = True can_delete = True + column_exclude_list = ['primary_investigator_id', 'primary_investigator', 'sponsor', 'ind_number', + 'investigator_id', 'investigator_uids', 'requirements', 'enrollment_date', 'short_name', + 'proposal_name', 'progress'] class ApprovalView(AdminModelView): diff --git a/crc/models/task_log.py b/crc/models/task_log.py index a1171f00..366ed78c 100644 --- a/crc/models/task_log.py +++ b/crc/models/task_log.py @@ -54,13 +54,15 @@ class TaskLogModelSchema(ma.Schema): if hasattr(obj, 'workflow_spec_id') and obj.workflow_spec_id is not None: workflow_spec = WorkflowSpecService().get_spec(obj.workflow_spec_id) category = WorkflowSpecService().get_category(workflow_spec.category_id) - return category.display_name + if category: + return category.display_name @staticmethod def get_workflow(obj): if hasattr(obj, 'workflow_spec_id') and obj.workflow_spec_id is not None: workflow_spec = WorkflowSpecService().get_spec(obj.workflow_spec_id) - return workflow_spec.display_name + if workflow_spec: + return workflow_spec.display_name class TaskLogQuery: