From ae2368534644ae4b6ed1c5cb3920a107afdf662f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 26 May 2021 14:02:35 -0400 Subject: [PATCH] Fix nsfw posts showing for non-logged in users. Fixes #1614 (#1615) --- crates/db_views/src/post_view.rs | 2 +- crates/db_views_actor/src/community_view.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index 1d8ea80e6..d0f46dad3 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -359,7 +359,7 @@ impl<'a> PostQueryBuilder<'a> { query = query.filter(post::creator_id.eq(creator_id)); } - if !self.show_nsfw.unwrap_or(true) { + if !self.show_nsfw.unwrap_or(false) { query = query .filter(post::nsfw.eq(false)) .filter(community::nsfw.eq(false)); diff --git a/crates/db_views_actor/src/community_view.rs b/crates/db_views_actor/src/community_view.rs index 63e529412..fc582857a 100644 --- a/crates/db_views_actor/src/community_view.rs +++ b/crates/db_views_actor/src/community_view.rs @@ -198,7 +198,7 @@ impl<'a> CommunityQueryBuilder<'a> { } }; - if !self.show_nsfw.unwrap_or(true) { + if !self.show_nsfw.unwrap_or(false) { query = query.filter(community::nsfw.eq(false)); };