Commit b3d08ff2 authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: allow passing an existing project when creating a Subscription Request

parent e1dc926c
portal = context.getPortalObject()
resource = context
if subscriber_person_value is None:
raise AssertionError('Can not find a person profile')
if (subscriber_person_value is None) or (subscriber_person_value.getPortalType() != 'Person'):
raise AssertionError('%s is not a person profile' % subscriber_person_value)
source_project_value = None
destination_project_value = None
......@@ -30,7 +30,8 @@ elif resource.getPortalType() == "Service":
elif resource.getRelativeUrl() == "service_module/slapos_virtual_master_subscription":
if project_value is None:
raise AssertionError('Project is required for %s %s' % (resource.getRelativeUrl(), project_value))
assert item_value is None
if item_value is not None:
assert project_value.getRelativeUrl() == item_value.getRelativeUrl()
item_value = project_value
trade_condition_type = "virtual_master"
else:
......
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