From be0a34f811c4880c014ab4671fe88d86c431fcf6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 25 May 2021 20:15:59 -0400 Subject: [PATCH] Fix nsfw posts showing for non-logged in users. Fixes #1614 --- 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)); };