From 3ed54bf7e8683869175867383942a9a2ecf5d791 Mon Sep 17 00:00:00 2001 From: Book-reader Date: Thu, 4 Sep 2025 19:15:57 +1200 Subject: [PATCH] Fix docker compose & the authservice `admin_count` function --- authservice/src/db/user.rs | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/authservice/src/db/user.rs b/authservice/src/db/user.rs index 989b58d..106060b 100644 --- a/authservice/src/db/user.rs +++ b/authservice/src/db/user.rs @@ -458,7 +458,7 @@ pub async fn user_count(db: &DatabaseConnection) -> Result Result { // dont fucking touch this, i don't know why it works but it does, it's actually evil // note: doesn't work - Ok(user::Entity::find().filter(user::Column::Flags.into_expr().binary(BinOper::LShift, Expr::value(63 - 2)).lt(1 << (63 - 2))) + Ok(user::Entity::find().filter(user::Column::Flags.into_expr().binary(BinOper::BitAnd, UserFlag::Administrator as i64).binary(BinOper::NotEqual, 0)) .count(db).await.map_err(|e| { error!("DATABASE ERROR WHILE ADMINCOUNT: {e}"); FetchUserError::DatabaseError diff --git a/docker-compose.yml b/docker-compose.yml index 7d8bca1..73cc7b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -77,7 +77,7 @@ services: - db env_file: ".env" image: nats:2.11.8 - cmd: "nats-server -js" + command: "-js" db: image: postgres:17 networks: