mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08:00
fix bug: user can't update mailbox address if it's already used by another account
This commit is contained in:
parent
383f633e41
commit
bcf1fa2510
1 changed files with 1 additions and 1 deletions
|
@ -263,7 +263,7 @@ def mailbox_confirm_change_route():
|
|||
|
||||
# new_email can be None if user cancels change in the meantime
|
||||
if mailbox and mailbox.new_email:
|
||||
if Mailbox.get_by(email=mailbox.new_email):
|
||||
if Mailbox.get_by(email=mailbox.new_email, user_id=current_user.id):
|
||||
flash(f"{mailbox.new_email} is already used", "error")
|
||||
return redirect(
|
||||
url_for("dashboard.mailbox_detail_route", mailbox_id=mailbox.id)
|
||||
|
|
Loading…
Reference in a new issue