##// END OF EJS Templates
allow underscores in usernames. Helps creating special internal users
marcink -
r3914:424b6c71 beta
parent child Browse files
Show More
@@ -88,7 +88,7 b' def ValidUsername(edit=False, old_data={'
88 'invalid_username':
88 'invalid_username':
89 _(u'Username may only contain alphanumeric characters '
89 _(u'Username may only contain alphanumeric characters '
90 'underscores, periods or dashes and must begin with '
90 'underscores, periods or dashes and must begin with '
91 'alphanumeric character')
91 'alphanumeric character or underscore')
92 }
92 }
93
93
94 def validate_python(self, value, state):
94 def validate_python(self, value, state):
@@ -105,7 +105,7 b' def ValidUsername(edit=False, old_data={'
105 msg = M(self, 'username_exists', state, username=value)
105 msg = M(self, 'username_exists', state, username=value)
106 raise formencode.Invalid(msg, value, state)
106 raise formencode.Invalid(msg, value, state)
107
107
108 if re.match(r'^[a-zA-Z0-9]{1}[a-zA-Z0-9\-\_\.]*$', value) is None:
108 if re.match(r'^[a-zA-Z0-9\_]{1}[a-zA-Z0-9\-\_\.]*$', value) is None:
109 msg = M(self, 'invalid_username', state)
109 msg = M(self, 'invalid_username', state)
110 raise formencode.Invalid(msg, value, state)
110 raise formencode.Invalid(msg, value, state)
111 return _validator
111 return _validator
General Comments 0
You need to be logged in to leave comments. Login now