Fixing library search shit.
authorMichael Gregson <mgregson@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 07:15:48 +0000 (03:15 -0400)
committerMichael Gregson <mgregson@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 07:15:48 +0000 (03:15 -0400)
ceo/urwid/library.py

index b68c562..ce7016c 100644 (file)
@@ -275,10 +275,14 @@ class SearchPage(urwid.WidgetWrap):
             books = lib.Book.select(LIKE(lib.Book.q.title, "%" + title + "%"))
         elif not isbn is None and not isbn=="":
             books = lib.Book.select(lib.Book.q.isbn==isbn)
-        elif not user is None and not user=="":
+        elif (not (user is None)) and (not (user=="")):
             st = lib.Signout.select(AND(lib.Signout.q.username==user, lib.Signout.q.indate==None))
             for s in st:
                 books.append(s.book)
+        else:
+            st = lib.Signout.select(lib.Signout.q.indate==None)
+            for s in st:
+                books.append(s.book)
 
         for b in books:
             widgets.append(urwid.AttrWrap(ButtonText(self.select, b, str(b)),