#20736: Fixing post when adding no value to new tag name

Work Item: 20736
This commit is contained in:
Nicholas Mayne
2014-06-22 23:08:46 +01:00
parent 64e1a745f5
commit c08d296395

View File

@@ -74,10 +74,10 @@ namespace Orchard.Tags.Controllers {
var viewModel = new TagsAdminCreateViewModel();
TryUpdateModel(viewModel);
if (viewModel.TagName.Intersect(TagsPartDriver.DisalowedChars).Any()) {
ModelState.AddModelError("_FORM", T("The tag \"{0}\" could not be added because it contains forbidden chars: {1}", viewModel.TagName, String.Join(", ", TagsPartDriver.DisalowedChars)));
if (TryUpdateModel(viewModel)) {
if (viewModel.TagName.Intersect(TagsPartDriver.DisalowedChars).Any()) {
ModelState.AddModelError("_FORM", T("The tag \"{0}\" could not be added because it contains forbidden chars: {1}", viewModel.TagName, String.Join(", ", TagsPartDriver.DisalowedChars)));
}
}
if(!ModelState.IsValid) {