From 02b705b22a6f83b983f9a441900ff2c35576d350 Mon Sep 17 00:00:00 2001 From: Kavika Date: Tue, 3 Dec 2024 01:19:02 +1100 Subject: [PATCH] only submitted applications are viewable by reviewers --- backend/server/src/models/application.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/server/src/models/application.rs b/backend/server/src/models/application.rs index 06d99af5..0dcafab1 100644 --- a/backend/server/src/models/application.rs +++ b/backend/server/src/models/application.rs @@ -147,7 +147,7 @@ impl Application { FROM applications a JOIN users u ON u.id = a.user_id JOIN campaigns c ON c.id = a.campaign_id - WHERE a.id = $1 AND (a.submitted = true OR c.ends_at <= CURRENT_TIMESTAMP) + WHERE a.id = $1 AND a.submitted = true ", id ) @@ -207,7 +207,7 @@ impl Application { JOIN users u ON u.id = a.user_id JOIN application_roles ar on ar.application_id = a.id JOIN campaigns c on c.id = a.campaign_id - WHERE ar.id = $1 AND (a.submitted = true OR c.ends_at <= CURRENT_TIMESTAMP) + WHERE ar.id = $1 AND a.submitted = true ", role_id ) @@ -273,7 +273,7 @@ impl Application { FROM applications a JOIN users u ON u.id = a.user_id JOIN campaigns c ON c.id = a.campaign_id - WHERE a.campaign_id = $1 AND (a.submitted = true OR c.ends_at <= CURRENT_TIMESTAMP) + WHERE a.campaign_id = $1 AND a.submitted = true ", campaign_id )