Commit 387de7e2 authored by Łukasz Nowak's avatar Łukasz Nowak

Do not use countResults, as it is slow.

parent cc6953ff
...@@ -373,7 +373,7 @@ class InstancePublisher(GenericPublisher): ...@@ -373,7 +373,7 @@ class InstancePublisher(GenericPublisher):
portal_type=('Software Instance', 'Slave Instance'), portal_type=('Software Instance', 'Slave Instance'),
) )
catalog = self.getPortalObject().portal_catalog catalog = self.getPortalObject().portal_catalog
if catalog.countResults(**kw)[0][0] == 0: if len(catalog(limit=1, **kw)) == 0:
self.REQUEST.response.setStatus(204) self.REQUEST.response.setStatus(204)
return self.REQUEST.response return self.REQUEST.response
d = {"list": []} d = {"list": []}
......
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