From b95bbe2fae4c0bb2f6d7bb5682d52149b258b239 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 1d8ea80e..d0f46dad 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 63e52941..fc582857 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)); }; -- 2.44.1