You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/04/01 23:10:23 UTC

[06/45] allura git commit: [#7833] ticket:741 Added .strip() to EmailAddress.canonical

[#7833] ticket:741 Added .strip() to EmailAddress.canonical


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/c2673b61
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c2673b61
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c2673b61

Branch: refs/heads/hss/7072
Commit: c2673b61721ea0b0d042a2a5dad802ca0f884249
Parents: 269703c
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Tue Mar 10 20:55:06 2015 +0200
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Thu Mar 19 18:37:45 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/auth.py            | 2 +-
 Allura/allura/tests/model/test_auth.py | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/c2673b61/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 0b92443..f7e8c91 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -169,7 +169,7 @@ class EmailAddress(MappedClass):
         if mo:
             addr = mo.group(1)
         if '@' in addr:
-            user, domain = addr.split('@')
+            user, domain = addr.strip().split('@')
             return '%s@%s' % (user, domain.lower())
         else:
             return None

http://git-wip-us.apache.org/repos/asf/allura/blob/c2673b61/Allura/allura/tests/model/test_auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_auth.py b/Allura/allura/tests/model/test_auth.py
index 12db982..eb7416c 100644
--- a/Allura/allura/tests/model/test_auth.py
+++ b/Allura/allura/tests/model/test_auth.py
@@ -103,6 +103,8 @@ def test_email_address_canonical():
                  'nobody@example.com')
     assert_equal(M.EmailAddress.canonical('I Am Nobody <no...@example.com>'),
                  'nobody@example.com')
+    assert_equal(M.EmailAddress.canonical('  nobody@example.com\t'),
+                 'nobody@example.com')
     assert_equal(M.EmailAddress.canonical('invalid'), None)
 
 @with_setup(setUp)