]> Untitled Git - lemmy.git/commitdiff
Bugfix: Adds case-insensitive SELECT queries to User_::find_by_username() (#1108)
authorJoshua Thomas <personettelabs@gmail.com>
Sat, 29 Aug 2020 00:49:31 +0000 (20:49 -0400)
committerGitHub <noreply@github.com>
Sat, 29 Aug 2020 00:49:31 +0000 (20:49 -0400)
server/lemmy_db/src/user.rs

index 73da1c2446e52f49a8c451a1b7c7c7fbc6b50bd6..8416d38a1e1024e9aee628ff2929a236b810e0e8 100644 (file)
@@ -142,7 +142,7 @@ impl User_ {
   }
 
   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> {