def METHOD_NAME(queryset):
    if flag_set('fflag_fix_back_LSDV_961_project_list_09022023_short', user='auto'):
        subquery = Annotation.objects.filter(
            Q(project=OuterRef('pk'))
            & Q(was_cancelled=True)
        ).values('id')
        return queryset.annotate(skipped_annotations_number=SQCount(subquery))
    else:
        return queryset.annotate(skipped_annotations_number=Count(
            'tasks__annotations__id', distinct=True, filter=Q(tasks__annotations__was_cancelled=True)
        ))