[sagenb] 16/179: user_manager: made _user_lookup() handle a returned None gracefully

felix salfelder felix-guest at moszumanska.debian.org
Tue May 6 12:05:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit 7577eef8bfdd48bfd65675975956b8b270a24185
Author: Robin Martinjak <rob at rmartinjak.de>
Date:   Sun Jul 15 18:18:48 2012 +0200

    user_manager: made _user_lookup() handle a returned None gracefully
---
 sagenb/notebook/user_manager.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sagenb/notebook/user_manager.py b/sagenb/notebook/user_manager.py
index e612418..77adcd0 100644
--- a/sagenb/notebook/user_manager.py
+++ b/sagenb/notebook/user_manager.py
@@ -547,12 +547,13 @@ class ExtAuthUserManager(SimpleUserManager):
         """
         Returns a list of usernames that are found when calling user_lookup on all enabled auth methods
         """
-        r = []
+        r = {}
         for a in self._auth_methods:
             if self._conf[a]:
-                # avoid duplicates
-                r += [u for u in self._auth_methods[a].user_lookup(search) if u not in r]
-        return r
+                names = self._auth_methods[a].user_lookup(search)
+                if names:
+                    r = r.union(names)
+        return list(r)
 
 class OpenIDUserManager(ExtAuthUserManager):
     def __init__(self, accounts=True, conf=None):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list