Fix docker compose & the authservice admin_count function

This commit is contained in:
Book-reader 2025-09-04 19:15:57 +12:00
parent 1370bc8a43
commit 3ed54bf7e8
2 changed files with 2 additions and 2 deletions

View file

@ -458,7 +458,7 @@ pub async fn user_count(db: &DatabaseConnection) -> Result<usize, FetchUserError
pub async fn admin_count(db: &DatabaseConnection) -> Result<usize, FetchUserError> {
// 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

View file

@ -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: