X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fforms.py;h=fb920c7a0bd6417fc47bd6eda26f8cd04823494f;hb=b35c6feb2299e70f48c08170ddd216b6de3a0e76;hp=ab563d9d3591b215825f0fb7915ce843b98df999;hpb=fdc6eaa09a23c2fb8047078ca2447df395c31f6a;p=unfold.git diff --git a/portal/forms.py b/portal/forms.py index ab563d9d..fb920c7a 100644 --- a/portal/forms.py +++ b/portal/forms.py @@ -42,15 +42,15 @@ class UserRegisterForm(forms.Form): # Not ModelForm """ required_css_class = 'required' - first_name = forms.RegexField(regex=r'^[\w.@+-]+$', + first_name = forms.RegexField(regex=r'^[\w+\s.@+-]+$', max_length=30, label=_("First name"), error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")}) - last_name = forms.RegexField(regex=r'^[\w.@+-]+$', + last_name = forms.RegexField(regex=r'^[\w+\s.@+-]+$', max_length=30, label=_("Last name"), error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")}) - affiliation = forms.RegexField(regex=r'^[\w.@+-]+$', + affiliation = forms.RegexField(regex=r'^[\w+\s.@+-]+$', max_length=30, label=_("Affiliation"), error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")}) @@ -61,7 +61,9 @@ class UserRegisterForm(forms.Form): # Not ModelForm password2 = forms.CharField(widget=forms.PasswordInput, label=_("Password (again)")) keypair = forms.CharField( widget=forms.FileInput ) - + + #my_keypairs = forms.ChoiceField(widget = forms.Select(), + # choices = ([('1','generate'), ('2','upload')])) tos = forms.BooleanField(widget=forms.CheckboxInput, label=_(u'I have read and agree to the Terms of Service'), error_messages={'required': _("You must agree to the terms to register")}) @@ -130,3 +132,4 @@ class SliceRequestForm(forms.Form): email = forms.EmailField() cc_myself = forms.BooleanField(required=False) +