Commit ecbfe3fc authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Small fix, subscription_reference should be initiallised outside the "if"

parent d5c0d71e
......@@ -24,15 +24,13 @@ def assignComputerPartition(software_instance, hosting_subscription):
if not person.Person_isAllowedToAllocate():
raise Unauthorized('Allocation disallowed')
subscription_reference = None
subscription_request = hosting_subscription.getAggregateRelatedValue(
portal_type="Subscription Request")
if subscription_request is not None:
subscription_reference = subscription_request.getReference()
if subscription_request.getSimulationState() not in ["confirmed", "started"]:
raise Unauthorized("Related Subscription Requested isn't confirmed or started")
else:
subscription_reference = None
tag = None
try:
......
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