Bugfix: Adds case-insensitive SELECT queries to User_::find_by_username() (#1108)

This commit is contained in:
Joshua Thomas 2020-08-28 20:49:31 -04:00 committed by GitHub
parent 4819bd5608
commit 0f8372c0fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,7 +142,7 @@ impl User_ {
} }
pub fn find_by_username(conn: &PgConnection, username: &str) -> Result<User_, Error> { pub fn find_by_username(conn: &PgConnection, username: &str) -> Result<User_, Error> {
user_.filter(name.eq(username)).first::<User_>(conn) user_.filter(name.ilike(username)).first::<User_>(conn)
} }
pub fn find_by_email(conn: &PgConnection, from_email: &str) -> Result<User_, Error> { pub fn find_by_email(conn: &PgConnection, from_email: &str) -> Result<User_, Error> {