Skip to content

Commit 0797eb8

Browse files
committed
fix: update taxa query
1 parent 55f9a0d commit 0797eb8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ami/main/models.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,12 @@ def update_calculated_fields(self, save=False):
565565
.count()
566566
)
567567
self.taxa_count = (
568-
Taxon.objects.filter(
569-
occurrences__deployment=self,
570-
occurrences__determination_score__gte=settings.DEFAULT_CONFIDENCE_THRESHOLD,
571-
occurrences__event__isnull=False,
568+
self.occurrences.filter(
569+
determination_score__gte=settings.DEFAULT_CONFIDENCE_THRESHOLD,
570+
event__isnull=False,
571+
deployment=self,
572572
)
573+
.values_list("determination", flat=True)
573574
.distinct()
574575
.count()
575576
)

0 commit comments

Comments
 (0)