allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [3/4] allura git commit: [#7813] ticket:711 EmailAddress.find can be called without query
Date Tue, 13 Jan 2015 16:58:42 GMT
[#7813] ticket:711 EmailAddress.find can be called without query


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

Branch: refs/heads/ib/7813
Commit: 699c0d1df0f5ab731b58d776fd4da018e89c1387
Parents: 802ee46
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Jan 13 15:52:18 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Jan 13 15:52:18 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/auth.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/699c0d1d/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index c417a64..855bb6b 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -132,12 +132,14 @@ class EmailAddress(MappedClass):
         return cls.query.get(**kw)
 
     @classmethod
-    def find(cls, q):
+    def find(cls, q=None):
         '''Equivalent to Ming's query.find but calls self.canonical on address
         before lookup. You should always use this instead of query.find'''
-        if 'email' in q:
-            q['email'] = cls.canonical(q['email'])
-        return cls.query.find(q)
+        if q:
+            if 'email' in q:
+                q['email'] = cls.canonical(q['email'])
+            return cls.query.find(q)
+        return cls.query.find()
 
     def claimed_by_user(self, include_pending=False):
         q = {'_id': self.claimed_by_user_id,


Mime
View raw message