Changeset - 424b6c711a7f
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 12 years ago 2013-05-29 12:13:02
marcin@python-works.com
allow underscores in usernames. Helps creating special internal users
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/validators.py
Show inline comments
 
@@ -88,7 +88,7 @@ def ValidUsername(edit=False, old_data={
 
            'invalid_username':
 
                _(u'Username may only contain alphanumeric characters '
 
                  'underscores, periods or dashes and must begin with '
 
                  'alphanumeric character')
 
                  'alphanumeric character or underscore')
 
        }
 

	
 
        def validate_python(self, value, state):
 
@@ -105,7 +105,7 @@ def ValidUsername(edit=False, old_data={
 
                    msg = M(self, 'username_exists', state, username=value)
 
                    raise formencode.Invalid(msg, value, state)
 

	
 
            if re.match(r'^[a-zA-Z0-9]{1}[a-zA-Z0-9\-\_\.]*$', value) is None:
 
            if re.match(r'^[a-zA-Z0-9\_]{1}[a-zA-Z0-9\-\_\.]*$', value) is None:
 
                msg = M(self, 'invalid_username', state)
 
                raise formencode.Invalid(msg, value, state)
 
    return _validator
0 comments (0 inline, 0 general)