forked from jmug/stoatchat
Update src/routes/users/change_username.rs
Co-authored-by: Splatterxl <splatterxl@outlook.ie>
This commit is contained in:
@@ -45,8 +45,7 @@ pub async fn req(
|
|||||||
|
|
||||||
let mut set = doc! {};
|
let mut set = doc! {};
|
||||||
if let Some(username) = &data.username {
|
if let Some(username) = &data.username {
|
||||||
if username.to_lowercase() == user.username.to_lowercase() {
|
if (username.to_lowercase() != user.username.to_lowercase()) && User::is_username_taken(&username).await? {
|
||||||
} else if User::is_username_taken(&username).await? {
|
|
||||||
return Err(Error::UsernameTaken);
|
return Err(Error::UsernameTaken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user