Skip to content
Snippets Groups Projects
Verified Commit 7b3e61ed authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

make it impossible to skip past a provisioning proxy step without run results

parent 0f7d2317
No related branches found
No related tags found
1 merge request!30make it impossible to skip past a provisioning proxy step without run results
......@@ -14,6 +14,7 @@ from orchestrator.forms import FormPage, ReadOnlyField
from orchestrator.forms.validators import Accept, Label, LongText
from orchestrator.types import UUIDstr, State, strEnum
from orchestrator.utils.json import json_dumps
from pydantic import validator
from gso import settings
from gso.products.product_types.device import DeviceProvisioning
......@@ -179,6 +180,13 @@ def await_pp_results(subscription: SubscriptionModel,
pp_run_results: dict = None
confirm: Accept = Accept('INCOMPLETE')
@validator('pp_run_results', allow_reuse=True, pre=True, always=True)
def run_results_must_be_given(cls, run_results):
if run_results is None:
raise ValueError('Run results may not be empty. '
'Wait for the provisioning proxy to finish.')
return run_results
result_page = yield ProvisioningResultPage
return result_page.dict()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment