Mercurial > kallithea
comparison rhodecode/model/validators.py @ 3674:ff2ea58debb5 beta
fixed ldap tests when ldap lib is installed
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 04 Apr 2013 18:31:15 +0200 |
parents | 802c94bdfc85 |
children | 3563bb7b4b82 7e3d89d9d3a2 |
comparison
equal
deleted
inserted
replaced
3673:28305020a4ed | 3674:ff2ea58debb5 |
---|---|
721 'invalid_cn': | 721 'invalid_cn': |
722 _(u'The LDAP Login attribute of the CN must be specified - ' | 722 _(u'The LDAP Login attribute of the CN must be specified - ' |
723 'this is the name of the attribute that is equivalent ' | 723 'this is the name of the attribute that is equivalent ' |
724 'to "username"') | 724 'to "username"') |
725 } | 725 } |
726 | 726 messages['empty'] = messages['invalid_cn'] |
727 def validate_python(self, value, state): | |
728 if not value or not isinstance(value, (str, unicode)): | |
729 msg = M(self, 'invalid_cn', state) | |
730 raise formencode.Invalid(msg, value, state, | |
731 error_dict=dict(ldap_attr_login=msg) | |
732 ) | |
733 | 727 |
734 return _validator | 728 return _validator |
735 | 729 |
736 | 730 |
737 def NotReviewedRevisions(repo_id): | 731 def NotReviewedRevisions(repo_id): |