From 064540727cb134b58aaa0e55faad92f2a0350039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr> Date: Mon, 11 Sep 2017 22:38:08 +0200 Subject: [PATCH] add required attribute to PDB id field in the wizard through an HTML attribute, which is the only working way within the wizard, don't know why :( Former-commit-id: 0b7bcba915c0582ce361df669215eec31cfbe0e5 --- ippisite/ippidb/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ippisite/ippidb/forms.py b/ippisite/ippidb/forms.py index 8aabad3a..35e35581 100644 --- a/ippisite/ippidb/forms.py +++ b/ippisite/ippidb/forms.py @@ -32,7 +32,7 @@ def validate_pdb_exists(value): raise ValidationError('PDB entry not found: %(value)s', params={'value': value}, code='invalid') class PDBForm(forms.Form): - pdb_id = forms.CharField(label="PDB ID",max_length=4, widget=forms.TextInput(attrs={'placeholder': 'e.g 4HHB'}), required=True, validators=[ + pdb_id = forms.CharField(label="PDB ID",max_length=4, widget=forms.TextInput(attrs={'placeholder': 'e.g 4HHB', 'required':'required'}), required=True, validators=[ RegexValidator('^[0-9][a-zA-Z0-9]{3}$', message='PDB ID must be 1 numeric + 3 alphanumeric characters'), validate_pdb_exists ]) -- GitLab