From c21942983ac19f0cf90c0141b26e627f98b5fccf Mon Sep 17 00:00:00 2001 From: Nurfog Date: Tue, 14 Apr 2026 13:58:58 -0400 Subject: [PATCH] feat: add organization-level certificate toggle and update tower-governor imports --- .../migrations/20260414000001_add_certificate_toggle.sql | 6 ++++++ services/cms-service/src/main.rs | 3 ++- services/lms-service/src/main.rs | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/services/cms-service/migrations/20260414000001_add_certificate_toggle.sql b/services/cms-service/migrations/20260414000001_add_certificate_toggle.sql index 6cc2760..d91fb1e 100644 --- a/services/cms-service/migrations/20260414000001_add_certificate_toggle.sql +++ b/services/cms-service/migrations/20260414000001_add_certificate_toggle.sql @@ -4,5 +4,11 @@ ALTER TABLE organization_exercise_settings ADD COLUMN IF NOT EXISTS certificates_enabled BOOLEAN NOT NULL DEFAULT TRUE; +ALTER TABLE organizations + ADD COLUMN IF NOT EXISTS certificates_enabled BOOLEAN NOT NULL DEFAULT TRUE; + COMMENT ON COLUMN organization_exercise_settings.certificates_enabled IS 'Enable/disable built-in certificate generation. When false, students cannot generate/download certificates from the platform.'; + +COMMENT ON COLUMN organizations.certificates_enabled + IS 'Enable/disable built-in certificate generation. When false, students cannot generate/download certificates from the platform.'; diff --git a/services/cms-service/src/main.rs b/services/cms-service/src/main.rs index c7235b3..880a072 100644 --- a/services/cms-service/src/main.rs +++ b/services/cms-service/src/main.rs @@ -161,7 +161,8 @@ async fn main() { ]) .expose_headers([header::CONTENT_LENGTH, header::CONTENT_TYPE, header::CONTENT_RANGE, header::ACCEPT_RANGES]); - use tower_governor::{GovernorConfigBuilder, GovernorLayer}; + use tower_governor::governor::GovernorConfigBuilder; + use tower_governor::GovernorLayer; use std::sync::Arc; let governor_conf = Arc::new( diff --git a/services/lms-service/src/main.rs b/services/lms-service/src/main.rs index 266967f..0543086 100644 --- a/services/lms-service/src/main.rs +++ b/services/lms-service/src/main.rs @@ -119,7 +119,8 @@ async fn main() { ]) .expose_headers([header::CONTENT_LENGTH, header::CONTENT_TYPE]); - use tower_governor::{GovernorConfigBuilder, GovernorLayer}; + use tower_governor::governor::GovernorConfigBuilder; + use tower_governor::GovernorLayer; use std::sync::Arc; let governor_conf = Arc::new(