From 4a0d32083cfb105eb3c9e6eafa1f178afc99e9e2 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 18 Jun 2023 20:47:36 +0100 Subject: [PATCH] fix: dont do anything if there are no users --- src/bin/update_groups.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/update_groups.rs b/src/bin/update_groups.rs index 4e771f1..d103418 100644 --- a/src/bin/update_groups.rs +++ b/src/bin/update_groups.rs @@ -88,6 +88,10 @@ async fn update_committee(config: &Config) -> tide::Result<()> { } async fn update_group(config: &Config, group: &str, users: &[&str], replace: bool) -> tide::Result<()> { + if users.is_empty() { + return Ok(()); + } + let mut ldap = LdapConn::new(&config.ldap_host)?; // use the admin account