From 11f2f635921dbb9e8d59898d4156339403850e99 Mon Sep 17 00:00:00 2001 From: saikumarswimlane <164332514+saikumarswimlane@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:09:02 +0530 Subject: [PATCH] fix(SPT-32187): added error message for record.search (#208) * fix(SPT-32187): added error message for record.search * feat(SPT-32187): updated exception handler for mutliselect --------- Co-authored-by: SaiKumar Kondapalli --- swimlane/core/fields/base/field.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/swimlane/core/fields/base/field.py b/swimlane/core/fields/base/field.py index b393bfd..b99eeb7 100644 --- a/swimlane/core/fields/base/field.py +++ b/swimlane/core/fields/base/field.py @@ -66,10 +66,19 @@ def get_report(self, value): """Return provided field Python value formatted for use in report filter""" if self.multiselect: value = value or [] + try: + list_vars = vars(value) + if "multiselect" in list_vars: + pass + except : + if not isinstance(value, list) : + raise TypeError("Value Expected a list, but got something else.") children = [] for child in value: - children.append(self.cast_to_report(child)) + id = self.cast_to_report(child) + if id: + children.append(id) return children