Fix nsfw posts showing for non-logged in users. Fixes #1614 (#1615)

upgrade_front_deps_3
Dessalines 2021-05-26 14:02:35 -04:00 committed by GitHub
parent 7008848f9c
commit b95bbe2fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -359,7 +359,7 @@ impl<'a> PostQueryBuilder<'a> {
query = query.filter(post::creator_id.eq(creator_id)); 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 query = query
.filter(post::nsfw.eq(false)) .filter(post::nsfw.eq(false))
.filter(community::nsfw.eq(false)); .filter(community::nsfw.eq(false));

View 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)); query = query.filter(community::nsfw.eq(false));
}; };