From 73b88a8c17156de3c336b469801ca19db37ede99 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 6 Jan 2024 02:51:57 -0800 Subject: [PATCH] fix: update user email issue --- backend/apps/web/routers/users.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/apps/web/routers/users.py b/backend/apps/web/routers/users.py index 753ad05a..32d1e67f 100644 --- a/backend/apps/web/routers/users.py +++ b/backend/apps/web/routers/users.py @@ -73,8 +73,8 @@ async def update_user_by_id( user = Users.get_user_by_id(user_id) if user: - if form_data.email != user.email: - email_user = Users.get_user_by_email(form_data.email) + if form_data.email.lower() != user.email: + email_user = Users.get_user_by_email(form_data.email.lower()) if email_user: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, @@ -86,12 +86,12 @@ async def update_user_by_id( print(hashed) Auths.update_user_password_by_id(user_id, hashed) - Auths.update_email_by_id(user_id, form_data.email) + Auths.update_email_by_id(user_id, form_data.email.lower()) updated_user = Users.update_user_by_id( user_id, { "name": form_data.name, - "email": form_data.email, + "email": form_data.email.lower(), "profile_image_url": form_data.profile_image_url, }, )