no need to check for deletedAlias when changing mailbox or user email

This commit is contained in:
Son NK 2020-05-23 19:50:04 +02:00
parent adce27b88b
commit 9bb17533c1
2 changed files with 2 additions and 5 deletions

View file

@ -51,7 +51,6 @@ def mailbox_detail_route(mailbox_id):
if (
mailbox_already_used(new_email, current_user)
or Alias.get_by(email=new_email)
or DeletedAlias.get_by(email=new_email)
):
flash(f"Email {new_email} already used", "error")
elif not email_domain_can_be_used_as_mailbox(new_email):

View file

@ -73,10 +73,8 @@ def setting():
new_email = change_email_form.email.data
# check if this email is not already used
if (
personal_email_already_used(new_email)
or Alias.get_by(email=new_email)
or DeletedAlias.get_by(email=new_email)
if personal_email_already_used(new_email) or Alias.get_by(
email=new_email
):
flash(f"Email {new_email} already used", "error")
elif not email_domain_can_be_used_as_mailbox(new_email):