Mercurial > kallithea
comparison rhodecode/model/validators.py @ 3186:fc26083c7436 beta
make email validation regexp match the error description - single letter is ok
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 21 Jan 2013 19:47:11 +0100 |
parents | 68f9c216377d |
children | 6c28533d122c |
comparison
equal
deleted
inserted
replaced
3185:a665d8cdd351 | 3186:fc26083c7436 |
---|---|
101 if old_un != value or not edit: | 101 if old_un != value or not edit: |
102 if User.get_by_username(value, case_insensitive=True): | 102 if User.get_by_username(value, case_insensitive=True): |
103 msg = M(self, 'username_exists', state, username=value) | 103 msg = M(self, 'username_exists', state, username=value) |
104 raise formencode.Invalid(msg, value, state) | 104 raise formencode.Invalid(msg, value, state) |
105 | 105 |
106 if re.match(r'^[a-zA-Z0-9]{1}[a-zA-Z0-9\-\_\.]+$', value) is None: | 106 if re.match(r'^[a-zA-Z0-9]{1}[a-zA-Z0-9\-\_\.]*$', value) is None: |
107 msg = M(self, 'invalid_username', state) | 107 msg = M(self, 'invalid_username', state) |
108 raise formencode.Invalid(msg, value, state) | 108 raise formencode.Invalid(msg, value, state) |
109 return _validator | 109 return _validator |
110 | 110 |
111 | 111 |