From 41700cf56d11a1e4e16e66d936977a8a29ee8770 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Tue, 15 Apr 2014 17:19:58 -0700 Subject: [PATCH] Changes with this checkin: adding a work around to test the account/manage user feature. With this I can verify password changes work fine. --- src/MusicStore/Controllers/AccountController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/MusicStore/Controllers/AccountController.cs b/src/MusicStore/Controllers/AccountController.cs index 1aa0e88e0c..0dd7087571 100644 --- a/src/MusicStore/Controllers/AccountController.cs +++ b/src/MusicStore/Controllers/AccountController.cs @@ -122,7 +122,10 @@ namespace MusicStore.Controllers // // GET: /Account/Manage - public async Task Manage(ManageMessageId? message) + [HttpGet] + //Bug: https://github.com/aspnet/WebFx/issues/256. Unable to model bind for a nullable value. Work around to remove the nullable + //public async Task Manage(ManageMessageId? message) + public async Task Manage(ManageMessageId message) { ViewBag.StatusMessage = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." @@ -139,7 +142,8 @@ namespace MusicStore.Controllers public async Task Manage(ManageUserViewModel model) { ViewBag.ReturnUrl = Url.Action("Manage"); - if (ModelState.IsValid == true) + //Bug: https://github.com/aspnet/DataAnnotations/issues/21 + //if (ModelState.IsValid == true) { var user = await GetCurrentUserAsync(); var result = await UserManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); @@ -152,6 +156,7 @@ namespace MusicStore.Controllers AddErrors(result); } } + // If we got this far, something failed, redisplay form return View(model); }