Null check to fetch local users

This commit is contained in:
Natty 2023-04-22 02:37:18 +02:00
parent bc95aa4efa
commit 6bf7b17bab
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,11 @@ impl CalckeyModel {
.filter(user::Column::UsernameLower.eq(name))
.filter(user::Column::Host.eq(instance))
} else {
user::Entity::find().filter(user::Column::UsernameLower.eq(name))
user::Entity::find().filter(
user::Column::UsernameLower
.eq(name)
.and(user::Column::Host.is_null()),
)
}
.one(&self.0)
.await?;