#16849: Replacing strings and console.writelines by exception throwing.

--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-12-08 18:18:52 -08:00
parent c57a3ab642
commit 18d1e80189
12 changed files with 78 additions and 84 deletions

View File

@@ -333,9 +333,8 @@ namespace Orchard.Users.Controllers {
if (!validate)
return false;
string userUnicityMessage = _userService.VerifyUserUnicity(userName, email);
if (userUnicityMessage != null) {
ModelState.AddModelError("userExists", T(userUnicityMessage));
if (!_userService.VerifyUserUnicity(userName, email)) {
ModelState.AddModelError("userExists", T("User with that username and/or email already exists."));
}
if (password == null || password.Length < MinPasswordLength) {
ModelState.AddModelError("password", T("You must specify a password of {0} or more characters.", MinPasswordLength));