From e9bd8dee3b0350c08d16d57bfd008a72cb283c48 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 28 Aug 2007 16:01:07 -0700 Subject: Change user search to be asynchronous. This way it returns results even if the search times out. The find_users() search now returns a counter as the first result, which is set to -1 if the results are partial. --- ipa-server/ipa-gui/ipagui/controllers.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ipa-server/ipa-gui/ipagui/controllers.py') diff --git a/ipa-server/ipa-gui/ipagui/controllers.py b/ipa-server/ipa-gui/ipagui/controllers.py index ca2d15a2..ebd0b20d 100644 --- a/ipa-server/ipa-gui/ipagui/controllers.py +++ b/ipa-server/ipa-gui/ipagui/controllers.py @@ -140,10 +140,16 @@ class Root(controllers.RootController): def userlist(self, **kw): """Retrieve a list of all users and display them in one huge list""" users = None + counter = 0 uid = kw.get('uid') if uid != None and len(uid) > 0: try: users = client.find_users(uid.encode('utf-8')) + counter = users[0] + users = users[1:] + if counter == -1: + turbogears.flash("These results are truncated.\n" + + "Please refine your search and try again.") except ipaerror.IPAError, e: turbogears.flash("User list failed: " + str(e)) raise turbogears.redirect("/userlist") -- cgit