aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/workflow/forms.py')
-rw-r--r--src/workflow/forms.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/workflow/forms.py b/src/workflow/forms.py
index ee44ecd..a2746f9 100644
--- a/src/workflow/forms.py
+++ b/src/workflow/forms.py
@@ -15,6 +15,7 @@ from django.template.loader import render_to_string
from django.forms.widgets import NumberInput
import json
+import urllib
from account.models import Lab
from account.models import UserProfile
@@ -428,6 +429,24 @@ class ConfirmationForm(forms.Form):
)
+def validate_step(value):
+ if value not in ["prev", "next", "current"]:
+ raise ValidationError(str(value) + " is not allowed")
+
+
+def validate_step_form(value):
+ try:
+ urllib.parse.unquote_plus(value)
+ except Exception:
+ raise ValidationError("Value is not url encoded data")
+
+
+class ManagerForm(forms.Form):
+ step = forms.CharField(widget=forms.widgets.HiddenInput, validators=[validate_step])
+ step_form = forms.CharField(widget=forms.widgets.HiddenInput, validators=[validate_step_form])
+ # other fields?
+
+
class OPNFVSelectionForm(forms.Form):
installer = forms.ModelChoiceField(queryset=Installer.objects.all(), required=True)
scenario = forms.ModelChoiceField(queryset=Scenario.objects.all(), required=True)