From 65f0429597b3f07df6361940fa58889abd50e9ab Mon Sep 17 00:00:00 2001 From: Mikey Saugstad Date: Wed, 24 Aug 2022 19:31:44 -0700 Subject: [PATCH] removes labels validated as incorrect from API --- app/models/attribute/UserClusteringSessionTable.scala | 3 ++- app/models/user/UserStatTable.scala | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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.