mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing new content type validation
Work Item: 16471 --HG-- branch : dev
This commit is contained in:
@@ -52,13 +52,13 @@ namespace Orchard.ContentTypes.Controllers {
|
||||
ModelState.AddModelError("DisplayName", T("A type with the same name already exists.").ToString());
|
||||
}
|
||||
|
||||
var typeViewModel = _contentDefinitionService.AddType(viewModel);
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
Services.TransactionManager.Cancel();
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
var typeViewModel = _contentDefinitionService.AddType(viewModel);
|
||||
|
||||
Services.Notifier.Information(T("The \"{0}\" content type has been created.", typeViewModel.DisplayName));
|
||||
|
||||
return RedirectToAction("Edit", new { id = typeViewModel.Name });
|
||||
|
Reference in New Issue
Block a user