allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/4] allura git commit: [#7813] ticket:711 Use canonicalized address when saving new email & remove redundant calls to canonical
Date Mon, 19 Jan 2015 15:29:41 GMT
[#7813] ticket:711 Use canonicalized address when saving new email & remove redundant calls
to canonical


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

Branch: refs/heads/master
Commit: 87a80f2ebcf5d837411f600abf96a58c0491217e
Parents: cd4ac76
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Jan 13 15:12:11 2015 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Jan 19 15:20:16 2015 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/auth.py | 2 +-
 Allura/allura/lib/mail_util.py    | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/87a80f2e/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index c81c572..453ad8a 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -489,8 +489,8 @@ class PreferencesController(BaseController):
                 flash('Email address already claimed', 'error')
 
             elif mail_util.isvalid(new_addr['addr']):
-                user.email_addresses.append(new_addr['addr'])
                 em = M.EmailAddress.create(new_addr['addr'])
+                user.email_addresses.append(em.email)
                 em.claimed_by_user_id = user._id
 
                 confirmed_emails = filter(lambda email: email.confirmed, claimed_emails)

http://git-wip-us.apache.org/repos/asf/allura/blob/87a80f2e/Allura/allura/lib/mail_util.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/mail_util.py b/Allura/allura/lib/mail_util.py
index bef2403..68a9649 100644
--- a/Allura/allura/lib/mail_util.py
+++ b/Allura/allura/lib/mail_util.py
@@ -158,14 +158,13 @@ def parse_message(data):
 def identify_sender(peer, email_address, headers, msg):
     from allura import model as M
     # Dumb ID -- just look for email address claimed by a particular user
-    addr = M.EmailAddress.get(
-        email=M.EmailAddress.canonical(email_address), confirmed=True)
+    addr = M.EmailAddress.get(email=email_address, confirmed=True)
     if addr and addr.claimed_by_user_id:
         return addr.claimed_by_user() or M.User.anonymous()
     from_address = headers.get('From', '').strip()
     if not from_address:
         return M.User.anonymous()
-    addr = M.EmailAddress.get(email=M.EmailAddress.canonical(from_address))
+    addr = M.EmailAddress.get(email=from_address)
     if addr and addr.claimed_by_user_id:
         return addr.claimed_by_user() or M.User.anonymous()
     return M.User.anonymous()


Mime
View raw message