Skip to content

Commit

Permalink
remove duplicate deleted challenge/project filters
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Jul 19, 2024
1 parent 875d807 commit 7a324d6
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
"""
Expand Down

0 comments on commit 7a324d6

Please sign in to comment.