Exclude instance user when counting local users

This commit is contained in:
Kitaiti Makoto 2023-03-20 00:19:42 +09:00
parent cfa74f84e7
commit ec030d500d

View File

@ -186,6 +186,7 @@ impl User {
pub fn count_local(conn: &Connection) -> Result<i64> {
users::table
.filter(users::instance_id.eq(Instance::get_local()?.id))
.filter(users::role.ne(Role::Instance as i32))
.count()
.get_result(conn)
.map_err(Error::from)