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