Browse Source

strip contact email before adding

Son NK 5 years ago
parent
commit
ab2aa2bfbb
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/dashboard/views/alias_contact_manager.py

+ 2 - 1
app/dashboard/views/alias_contact_manager.py

@@ -24,6 +24,7 @@ def email_validator():
 
     def _check(form, field):
         email = field.data
+        email = email.strip()
         email_part = email
 
         if "<" in email and ">" in email:
@@ -66,7 +67,7 @@ def alias_contact_manager(alias_id, forward_email_id=None):
     if request.method == "POST":
         if request.form.get("form-name") == "create":
             if new_contact_form.validate():
-                contact_email = new_contact_form.email.data
+                contact_email = new_contact_form.email.data.strip()
 
                 # generate a reply_email, make sure it is unique
                 # not use while to avoid infinite loop