allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [1/3] allura git commit: [#7833] ticket:741 Added .strip() to EmailAddress.canonical
Date Mon, 16 Mar 2015 09:54:16 GMT
Repository: allura
Updated Branches:
  refs/heads/ib/7833 [created] c204f36bd


[#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/c8e40216
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c8e40216
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c8e40216

Branch: refs/heads/ib/7833
Commit: c8e40216e628a55de540c34bc26acf521a2c7606
Parents: 0126faa
Author: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Authored: Tue Mar 10 20:55:06 2015 +0200
Committer: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Committed: Wed Mar 11 20:03:14 2015 +0200

----------------------------------------------------------------------
 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/c8e40216/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/c8e40216/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 <nobody@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)


Mime
View raw message