# HG changeset patch # User Marcin Kuzminski # Date 2013-05-29 10:13:02 # Node ID 424b6c711a7f63680abd1474b66ddf42c0345a16 # Parent 5f192af1ba2134973a737ac3204f3c77b2823265 allow underscores in usernames. Helps creating special internal users diff --git a/rhodecode/model/validators.py b/rhodecode/model/validators.py --- a/rhodecode/model/validators.py +++ b/rhodecode/model/validators.py @@ -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