hide nsfw for loggedout users

master
Aevann 2024-02-15 15:44:19 +02:00
parent e34cc311be
commit e2876f4e1b
1 changed files with 1 additions and 0 deletions

View File

@ -6,6 +6,7 @@ from flask import request
def can_see(user, other):
if isinstance(other, (Post, Comment)):
if not user and other.nsfw: return False
if not can_see(user, other.author): return False
if user and user.id == other.author_id: return True
if isinstance(other, Post):