From e766759b8c271faa28f0635756ace152ae6a6d5b Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:08:18 -0400 Subject: [PATCH] Fix scheduling bug (#693) * Fix scheduling bug * Fix comp err --- src/routes/v2/projects.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/routes/v2/projects.rs b/src/routes/v2/projects.rs index d7c82b35..d6e9d4f2 100644 --- a/src/routes/v2/projects.rs +++ b/src/routes/v2/projects.rs @@ -1596,6 +1596,18 @@ pub async fn project_schedule( )); } + if !project_item.inner.status.is_approved() { + return Err(ApiError::InvalidInput( + "This project has not been approved yet. Submit to the queue with the private status to schedule it in the future!".to_string(), + )); + } + + if project_item.inner.webhook_sent { + return Err(ApiError::InvalidInput( + "This project already has been published. It cannot be scheduled!".to_string(), + )); + } + sqlx::query!( " UPDATE mods