forked from open-webui/open-webui
fix: update user email issue
This commit is contained in:
parent
f1bda3f9c8
commit
73b88a8c17
1 changed files with 4 additions and 4 deletions
|
@ -73,8 +73,8 @@ async def update_user_by_id(
|
||||||
user = Users.get_user_by_id(user_id)
|
user = Users.get_user_by_id(user_id)
|
||||||
|
|
||||||
if user:
|
if user:
|
||||||
if form_data.email != user.email:
|
if form_data.email.lower() != user.email:
|
||||||
email_user = Users.get_user_by_email(form_data.email)
|
email_user = Users.get_user_by_email(form_data.email.lower())
|
||||||
if email_user:
|
if email_user:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_400_BAD_REQUEST,
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
|
@ -86,12 +86,12 @@ async def update_user_by_id(
|
||||||
print(hashed)
|
print(hashed)
|
||||||
Auths.update_user_password_by_id(user_id, 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(
|
updated_user = Users.update_user_by_id(
|
||||||
user_id,
|
user_id,
|
||||||
{
|
{
|
||||||
"name": form_data.name,
|
"name": form_data.name,
|
||||||
"email": form_data.email,
|
"email": form_data.email.lower(),
|
||||||
"profile_image_url": form_data.profile_image_url,
|
"profile_image_url": form_data.profile_image_url,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue