diff --git a/app/models/attribute/UserClusteringSessionTable.scala b/app/models/attribute/UserClusteringSessionTable.scala index 2aaefc95b7..1bbbe0ba78 100644 --- a/app/models/attribute/UserClusteringSessionTable.scala +++ b/app/models/attribute/UserClusteringSessionTable.scala @@ -74,7 +74,8 @@ object UserClusteringSessionTable { _lab <- LabelTable.labelsWithoutDeletedOrOnboarding if _lab.missionId === _mission.missionId _latlng <- LabelTable.labelPoints if _lab.labelId === _latlng.labelId _type <- LabelTable.labelTypes if _lab.labelTypeId === _type.labelTypeId - if _region.deleted === false + if _region.deleted === false && + (_lab.correct.isEmpty || _lab.correct === true) // Filter out labels validated as incorrect. } yield (_mission.userId, _lab.labelId, _type.labelType, _latlng.lat, _latlng.lng, _lab.severity, _lab.temporary) labels.list.map(LabelToCluster.tupled) diff --git a/app/models/user/UserStatTable.scala b/app/models/user/UserStatTable.scala index cad9c895ad..db5ac0be6b 100644 --- a/app/models/user/UserStatTable.scala +++ b/app/models/user/UserStatTable.scala @@ -133,7 +133,8 @@ object UserStatTable { _stat <- userStats if _stat.highQuality _mission <- MissionTable.auditMissions if _mission.userId === _stat.userId _label <- LabelTable.labelsWithoutDeletedOrOnboarding if _mission.missionId === _label.missionId - if _label.timeCreated > cutoffTime + if (_label.correct.isEmpty || _label.correct === true) && // Filter out labels validated as incorrect. + _label.timeCreated > cutoffTime } yield _stat.userId // SELECT DISTINCT on the user_ids.