Commit 5b6579aa authored by Julien Muchembled's avatar Julien Muchembled

searchAndActivate: sorting results was useless when activity_count=None

parent 9321cec0
Pipeline #32288 failed with stage
in 0 seconds
......@@ -1376,13 +1376,17 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
group_method_cost = group_kw.get('group_method_cost', .034) # 30 objects
if limit == 0:
limit = 100 * int(ceil(1 / group_method_cost))
if min_uid:
catalog_kw['min_uid'] = SimpleQuery(uid=min_uid,
comparison_operator='>')
if catalog_kw.pop('restricted', False):
search = self
else:
search = self.unrestrictedSearchResults
if limit is None:
r = search(**catalog_kw)
else:
if min_uid:
catalog_kw['min_uid'] = SimpleQuery(uid=min_uid,
comparison_operator='>')
r = search(sort_on=(('uid','ascending'),), limit=limit, **catalog_kw)
result_count = len(r)
if result_count:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment