if len(tag) > settings.FORM_MAX_LENGTH_OF_TAG or len(tag) < settings.FORM_MIN_LENGTH_OF_TAG:
raise forms.ValidationError(_('please use between %(min)s and %(max)s characters in you tags') % { 'min': settings.FORM_MIN_LENGTH_OF_TAG, 'max': settings.FORM_MAX_LENGTH_OF_TAG})
if not tagname_re.match(tag):
- raise forms.ValidationError(_('please use following characters in tags: letters \'a-z\', numbers, and characters \'.-_#\''))
+ raise forms.ValidationError(_('please use following characters in tags: letters , numbers, and the following characters \'.-_#\''))
# only keep one same tag
if tag not in list_temp and len(tag.strip()) > 0:
list_temp.append(tag)
return clean_next(value)
login_form_widget_attrs = { 'class': 'required login' }
-username_re = re.compile(r'^[\w ]+$')
+username_re = re.compile(r'^[\w\s ]+$', re.UNICODE)
class UserNameField(StrippedNonEmptyCharField):
def __init__(self,db_model=User, db_field='username', must_exist=False,skip_clean=False,label=_('choose a username'),**kw):
raise forms.ValidationError(self.error_messages['required'])
if len(username) < settings.MIN_USERNAME_LENGTH:
raise forms.ValidationError(self.error_messages['toshort'])
- if self.required and not username_re.search(username):
+ if self.required and not username_re.match(username):
raise forms.ValidationError(self.error_messages['invalid'])
if username in settings.RESERVED_USERNAMES:
raise forms.ValidationError(self.error_messages['forbidden'])