Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
c55c8728
Unverified
Commit
c55c8728
authored
Jan 06, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Jan 06, 2024
Browse files
Merge pull request #405 from ollama-webui/fix
fix: update user email issue
parents
f1bda3f9
73b88a8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
backend/apps/web/routers/users.py
backend/apps/web/routers/users.py
+4
-4
No files found.
backend/apps/web/routers/users.py
View file @
c55c8728
...
...
@@ -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
,
},
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment