mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
Changing the Blog Create action to not try to add the blog slug to the blog slug constraint until after model state validation is verified.
--HG-- branch : dev
This commit is contained in:
@@ -67,13 +67,14 @@ namespace Orchard.Blogs.Controllers {
|
||||
|
||||
_blogService.Create(blog);
|
||||
model.Blog = _contentManager.UpdateEditorModel(blog, this);
|
||||
_blogSlugConstraint.AddSlug(model.Blog.Item.Slug);
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
_transactionManager.Cancel();
|
||||
return View(model);
|
||||
}
|
||||
|
||||
_blogSlugConstraint.AddSlug(model.Blog.Item.Slug);
|
||||
|
||||
return Redirect(Url.BlogForAdmin(model.Blog.Item.Slug));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user