Skip to content
Snippets Groups Projects
Commit 06454072 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

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
parent 8cc2539d
No related branches found
No related tags found
No related merge requests found
......@@ -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
])
......
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