Commit cb4406dc authored by Romain Courteaud's avatar Romain Courteaud

No need to count all results.

One is enough.
parent bf3971c8
......@@ -61,14 +61,15 @@ for software_release in portal.portal_catalog(\n
validation_state=\'published\',\n
default_aggregate_uid=context.getUid(),\n
sort_on=((\'indexation_timestamp\', \'DESC\'),)):\n
installed_count = portal.portal_catalog.countResults(\n
installed_count = portal.portal_catalog(\n
software_release_url=software_release.getUrlString(),\n
allocation_scope_uid=portal.portal_categories.allocation_scope.open.public.getUid(),\n
capacity_scope_uid=portal.portal_categories.capacity_scope.open.getUid(),\n
portal_type=\'Computer Partition\',\n
free_for_request=1\n
)[0][0]\n
if installed_count > 0:\n
free_for_request=1,\n
limit=1,\n
)\n
if len(installed_count) > 0:\n
software_release_url = software_release.getRelativeUrl()\n
break\n
\n
......
4
\ No newline at end of file
5
\ No newline at end of file
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