mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
feat: Do not allow suspending admin users
This commit is contained in:
@@ -235,6 +235,9 @@ pub(super) async fn suspend(&self, user_id: String) -> Result {
|
||||
if !self.services.users.exists(&user_id).await {
|
||||
return Err!("User {user_id} does not exist.");
|
||||
}
|
||||
if self.services.users.is_admin(&user_id).await {
|
||||
return Err!("Admin users cannot be suspended.");
|
||||
}
|
||||
self.services.users.suspend_account(&user_id).await;
|
||||
|
||||
self.write_str(&format!("User {user_id} has been suspended."))
|
||||
|
||||
Reference in New Issue
Block a user