Optional removals
@@ -39,6 +39,7 @@ use crate::{
companies::Company,
core::UpdateAirtableRecord,
db::Database,
+ features::Features,
gsuite::{update_gsuite_building, update_gsuite_calendar_resource},
providers::{ProviderReadOps, ProviderWriteOps},
schema::{applicants, buildings, groups, links, resources, users},
@@ -2094,7 +2095,13 @@ pub async fn sync_users(
// This is found by the remaining users that are in the map since we removed
// the existing repos from the map above.
for (username, user) in user_map {
- info!("deleting user `{}` from the database and other services", username);
+ if !Features::is_enabled("REMOTE_USER_DELETES") {
+ info!(
+ "User {} meets criteria for removal, but removals are currently disabled",
+ user.id
+ );
+ } else {
+ info!("deleting user `{}` from the database and other services", user.id);
let mut has_failures = false;
@@ -2246,6 +2253,7 @@ pub async fn sync_users(
info!("Skipping final user deletion due to previous delete steps failing");
}
}
+ }
info!("updated configs users in the database");
