From 9bb17533c117673b1195aa06fc9e47338c06b1c7 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sat, 23 May 2020 19:50:04 +0200 Subject: [PATCH] no need to check for deletedAlias when changing mailbox or user email --- app/dashboard/views/mailbox_detail.py | 1 - app/dashboard/views/setting.py | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/dashboard/views/mailbox_detail.py b/app/dashboard/views/mailbox_detail.py index a3ec4781..3643c3ea 100644 --- a/app/dashboard/views/mailbox_detail.py +++ b/app/dashboard/views/mailbox_detail.py @@ -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): diff --git a/app/dashboard/views/setting.py b/app/dashboard/views/setting.py index 53e64c6c..97e94ed3 100644 --- a/app/dashboard/views/setting.py +++ b/app/dashboard/views/setting.py @@ -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):