Commit 2b32c25d authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Allocation is unauthorized for the instance that don't have...

slapos_cloud: Allocation is unauthorized for the instance that don't have Subscription Request confirmed or started.
parent 04866a15
......@@ -24,6 +24,12 @@ def assignComputerPartition(software_instance, hosting_subscription):
if not person.Person_isAllowedToAllocate():
raise Unauthorized('Allocation disallowed')
subscription_request = hosting_subscription.getAggregateRelatedValue(
portal_type="Subscription Request")
if subscription_request is not None:
if subscription_request.getSimulationState() not in ["confirmed", "started"]:
raise Unauthorized("Related Subscription Requested isn't confirmed or started")
tag = None
try:
sla_dict = software_instance.getSlaXmlAsDict()
......
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