From e532e9a0c86e1ad88862c2d2ce5ecc222403e966 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 4 Jul 2024 11:52:08 +0200 Subject: ogcp: make client name field mandatory in client form Add InputRequired validator to the name field of the ClientDetailsForm. Validate name value in the POST function. --- ogcp/forms/action_forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ogcp/forms/action_forms.py') diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index c111940..7fbaa79 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -126,7 +126,8 @@ class FolderForm(FlaskForm): class ClientDetailsForm(FlaskForm): server = HiddenField() - name = StringField(label=_l('Name')) + name = StringField(label=_l('Name'), + validators=[InputRequired()]) ip = StringField(label=_l('IP'), validators=[InputRequired()]) mac = StringField(label=_l('MAC'), -- cgit v1.2.3-18-g5258