From 67ea321657ef89419a7120bd92ab0e7421c2d597 Mon Sep 17 00:00:00 2001 From: Brandon Martel Date: Fri, 29 Nov 2024 06:26:28 -0600 Subject: [PATCH] default to 0 not None --- label_studio/data_manager/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/label_studio/data_manager/api.py b/label_studio/data_manager/api.py index 7d99760b3d77..7b96e6b221b0 100644 --- a/label_studio/data_manager/api.py +++ b/label_studio/data_manager/api.py @@ -230,8 +230,8 @@ def paginate_totals_queryset(self, queryset, request, view=None): total_annotations=Sum('total_annotations') - Sum('cancelled_annotations'), total_predictions=Sum('total_predictions'), ) - self.total_annotations = totals['total_annotations'] - self.total_predictions = totals['total_predictions'] + self.total_annotations = totals.get('total_annotations', 0) + self.total_predictions = totals.get('total_predictions', 0) return super().paginate_queryset(queryset, request, view) def paginate_queryset(self, queryset, request, view=None):