Browse Source

Fix Whoosh search() function

Gu1 11 years ago
parent
commit
d6da45513d
1 changed files with 1 additions and 4 deletions
  1. 1 4
      ffdnispdb/models.py

+ 1 - 4
ffdnispdb/models.py

@@ -230,11 +230,8 @@ class ISPWhoosh(object):
                 return []
 
             _res=ISP.query.filter(ISP.id.in_(ranks.keys()))
-            res=[None]*_res.count()
-            for isp in _res:
-                res[ranks[isp.id]]=isp
 
-        return res
+        return sorted(_res, key=lambda r: ranks[r.id])
 
     @classmethod
     def update_document(cls, writer, model):