Commit 53decddb authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: search for Software Product Release Variation

parent c4fbc927
...@@ -2,19 +2,20 @@ portal = context.getPortalObject() ...@@ -2,19 +2,20 @@ portal = context.getPortalObject()
url_string = context.getUrlString() url_string = context.getUrlString()
software_product = None software_product = None
product_list = portal.portal_catalog(
portal_type="Software Product",
validation_state=['validated', 'published'],
use__relative_url="trade/sale",
follow_up__uid=context.getFollowUpUid()
)
release = portal.portal_catalog.getResultValue( release = portal.portal_catalog.getResultValue(
portal_type="Software Release", portal_type="Software Product Release Variation",
url_string=url_string, url_string=url_string,
follow_up__uid=context.getFollowUpUid(), parent_uid=[x.getUid() for x in product_list]
validation_state=['shared', 'shared_alive',
'released', 'released_alive',
'published', 'published_alive']
) )
if release is not None: if release is not None:
software_product = release.getAggregateValue( software_product = release.getParentValue()
checked_permission='Access contents information')
if software_product is not None:
if software_product.getValidationState() not in ['validated', 'published']:
software_product = None
return software_product return software_product
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