From aaefad12bb1ebf4578b9fb380453e75158f9ecf1 Mon Sep 17 00:00:00 2001 From: Aleks Berland <2853462+FuzzkingCool@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:40:48 -0400 Subject: [PATCH] Update client/ayon_core/tools/utils/tasks_widget.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/utils/tasks_widget.py | 24 ++++++-------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/client/ayon_core/tools/utils/tasks_widget.py b/client/ayon_core/tools/utils/tasks_widget.py index 7e11ee3414..3c511620e9 100644 --- a/client/ayon_core/tools/utils/tasks_widget.py +++ b/client/ayon_core/tools/utils/tasks_widget.py @@ -413,24 +413,14 @@ class TasksProxyModel(QtCore.QSortFilterProxyModel): left_value = left.data(TASK_SORT_ROLE) right_value = right.data(TASK_SORT_ROLE) - if left_value == right_value: - return super().lessThan(left, right) - - # If values are strings, compare lexicographically - if isinstance(left_value, str) or isinstance(right_value, str): - left_str = "" if left_value is None else str(left_value) - right_str = "" if right_value is None else str(right_value) - return left_str < right_str - - # Otherwise treat as numeric order; None goes last - if right_value is None: - return True - if left_value is None: - return False - try: + if left_value != right_value: + if left_value is None: + return False + if right_value is None: + return True return left_value < right_value - except Exception: - return super().lessThan(left, right) + + return super().lessThan(left, right) class TasksWidget(QtWidgets.QWidget):