From 7a324d6cea3687152e2332bef529cbf80e42b17c Mon Sep 17 00:00:00 2001 From: CollinBeczak Date: Fri, 19 Jul 2024 15:23:53 -0500 Subject: [PATCH] remove duplicate deleted challenge/project filters --- .../framework/repository/TaskClusterRepository.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/org/maproulette/framework/repository/TaskClusterRepository.scala b/app/org/maproulette/framework/repository/TaskClusterRepository.scala index baa2117e..c7e7ea8e 100644 --- a/app/org/maproulette/framework/repository/TaskClusterRepository.scala +++ b/app/org/maproulette/framework/repository/TaskClusterRepository.scala @@ -76,8 +76,6 @@ class TaskClusterRepository @Inject() (override val db: Database, challengeDAL: query: Query, numberOfPoints: Int ): (StringBuilder, List[NamedParameter]) = { - val whereClause = query.filter.sql() + " AND c.deleted = false AND p.deleted = false" - val queryString = s"""FROM ( SELECT tasks.*, tasks.id as taskId, tasks.status as taskStatus, tasks.priority as taskPriority, tasks.geojson::TEXT as taskGeojson, @@ -87,12 +85,12 @@ class TaskClusterRepository @Inject() (override val db: Database, challengeDAL: CASE WHEN COUNT(*) < $numberOfPoints THEN COUNT(*) ELSE $numberOfPoints END FROM tasks $joinClause - WHERE ${whereClause} + WHERE ${query.filter.sql()} )::Integer ) OVER () AS kmeans, tasks.location as taskLocation, tasks.parent_id as challengeIds FROM tasks $joinClause - WHERE ${whereClause} + WHERE ${query.filter.sql()} ) AS ksub WHERE location IS NOT NULL """