Commit 9df847b4 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: return nothing is no Software Product is found

parent 4db1fa64
......@@ -4,20 +4,22 @@ software_product = None
software_release = None
software_type = None
use_category_uid = portal.restrictedTraverse("portal_categories/use/trade/sale").getUid(),
product_list = portal.portal_catalog(
portal_type="Software Product",
validation_state=['validated', 'published'],
use__relative_url="trade/sale",
use__uid=use_category_uid,
follow_up__uid=context.getFollowUpUid()
)
software_release = portal.portal_catalog.getResultValue(
if len(product_list) != 0:
software_release = portal.portal_catalog.getResultValue(
portal_type="Software Product Release Variation",
url_string=url_string,
parent_uid=[x.getUid() for x in product_list]
)
)
if software_release is not None:
if software_release is not None:
software_product = software_release.getParentValue()
software_type = portal.portal_catalog.getResultValue(
......
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