]> Untitled Git - lemmy.git/commitdiff
Fix nsfw posts showing for non-logged in users. Fixes #1614 (#1615)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 26 May 2021 18:02:35 +0000 (14:02 -0400)
committerGitHub <noreply@github.com>
Wed, 26 May 2021 18:02:35 +0000 (18:02 +0000)
crates/db_views/src/post_view.rs
crates/db_views_actor/src/community_view.rs

index 1d8ea80e607720a0e4b2492b79eacb1de16be9ba..d0f46dad33c97dc10065559e248c4462047ba6a5 100644 (file)
@@ -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));
index 63e52941264b764b025d5c709c926259486db3bc..fc582857aa1d64dda707321c36c1a2c345528fb7 100644 (file)
@@ -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));
     };