Show More
@@ -35,6 +35,7 from rhodecode import BACKENDS | |||
|
35 | 35 | import formencode |
|
36 | 36 | import logging |
|
37 | 37 | import os |
|
38 | import re | |
|
38 | 39 | import rhodecode.lib.helpers as h |
|
39 | 40 | |
|
40 | 41 | log = logging.getLogger(__name__) |
@@ -71,7 +72,16 def ValidUsername(edit, old_data): | |||
|
71 | 72 | case_insensitive=True): |
|
72 | 73 | raise formencode.Invalid(_('This username already exists') , |
|
73 | 74 | value, state) |
|
74 | ||
|
75 | ||
|
76 | ||
|
77 | if re.match(r'^[a-zA-Z0-9]{1}[a-zA-Z0-9\-]+$', value) is None: | |
|
78 | raise formencode.Invalid(_('Username may only contain ' | |
|
79 | 'alphanumeric characters ' | |
|
80 | 'or dashes and cannot begin with a dash'), | |
|
81 | value, state) | |
|
82 | ||
|
83 | ||
|
84 | ||
|
75 | 85 | return _ValidUsername |
|
76 | 86 | |
|
77 | 87 | class ValidPassword(formencode.validators.FancyValidator): |
General Comments 0
You need to be logged in to leave comments.
Login now