comparison rhodecode/model/forms.py @ 1765:eb5099dbf0e6 beta

fix small issue in forms
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 08 Dec 2011 01:31:11 +0200
parents 9dda1146327c
children 145677a36675
comparison
equal deleted inserted replaced
1764:39b49c999efb 1765:eb5099dbf0e6
413 413
414 def UniqSystemEmail(old_data): 414 def UniqSystemEmail(old_data):
415 class _UniqSystemEmail(formencode.validators.FancyValidator): 415 class _UniqSystemEmail(formencode.validators.FancyValidator):
416 def to_python(self, value, state): 416 def to_python(self, value, state):
417 value = value.lower() 417 value = value.lower()
418 if old_data.get('email').lower() != value: 418 if old_data.get('email','').lower() != value:
419 user = User.get_by_email(value, case_insensitive=True) 419 user = User.get_by_email(value, case_insensitive=True)
420 if user: 420 if user:
421 raise formencode.Invalid( 421 raise formencode.Invalid(
422 _("This e-mail address is already taken"), 422 _("This e-mail address is already taken"),
423 value, state) 423 value, state)