You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/01/19 16:29:43 UTC

[4/4] allura git commit: [#7813] ticket:711 EmailAddress.find can be called without query

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

Branch: refs/heads/master
Commit: 0e89609fe2c8970763ddaa8eaa9be04b14634b1c
Parents: 87a80f2
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Jan 13 15:52:18 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Jan 19 15:20:16 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/0e89609f/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,