Commit f0384a74 authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: try not to duplicate software product

parent e0fd9ff6
......@@ -2,6 +2,18 @@ from Products.ERP5Type.Message import translateString
portal = context.getPortalObject()
# First, search if the release already exists
software_release_variation = portal.portal_catalog.getResultValue(
portal_type="Software Product Release Variation",
url_string=software_release,
)
if software_release_variation is not None:
return software_release_variation.getParentValue().Base_redirect(
keep_items={
'portal_status_message': translateString('Software Product already exist.')
}
)
software_product = portal.software_product_module.newContent(
title=title,
follow_up_value=context
......
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