Handle duplicate email on signup correctly (fixes ticket #24)

This commit is contained in:
Ricky Zhou (周家杰) 2008-03-13 10:09:12 -04:00
parent cfd455e4cc
commit 22e0bed0bf

View file

@ -437,8 +437,8 @@ forward to working with you!
person.password = newpass['hash']
turbogears.flash(_('Your password has been emailed to you. Please log in with it and change your password'))
turbogears.redirect('/user/changepass')
except KeyError:
turbogears.flash(_("The username '%s' already Exists. Please choose a different username.") % username)
except IntegrityError:
turbogears.flash(_("An account has already been registered with that email address."))
turbogears.redirect('/user/new')
return dict()