From bafb11bb6dba0a286967402bf1874403e14e0860 Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Fri, 30 Sep 2016 13:41:24 -0700 Subject: [PATCH] Fixed redirect for blog posts not working right --- Teknik/Areas/Blog/Controllers/BlogController.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Teknik/Areas/Blog/Controllers/BlogController.cs b/Teknik/Areas/Blog/Controllers/BlogController.cs index 8612fe1..423d082 100644 --- a/Teknik/Areas/Blog/Controllers/BlogController.cs +++ b/Teknik/Areas/Blog/Controllers/BlogController.cs @@ -88,8 +88,7 @@ namespace Teknik.Areas.Blog.Controllers PostViewModel model = new PostViewModel(); // find the post specified bool isAuth = User.IsInRole("Admin"); - var post = db.BlogPosts.Where(p => (p.Blog.User.Username == username && p.BlogPostId == id) && - (p.Published || p.Blog.User.Username == User.Identity.Name || isAuth)).FirstOrDefault(); + var post = db.BlogPosts.Where(p => p.BlogPostId == id && (p.Published || p.Blog.User.Username == User.Identity.Name || isAuth)).FirstOrDefault(); if (post != null) { model = new PostViewModel(post);