paypig-only threads

pull/134/head
Aevann 2023-02-26 13:22:30 +02:00
parent 615d71dda0
commit 490d5765fa
1 changed files with 5 additions and 2 deletions

View File

@ -968,12 +968,15 @@ class User(Base):
Whether a user can strictly see this item. can_see_content is used where Whether a user can strictly see this item. can_see_content is used where
content of a thing can be hidden from view content of a thing can be hidden from view
''' '''
browser = g and g.browser # TODO: request state object to pass to models for purity
if isinstance(other, (Submission, Comment)): if isinstance(other, (Submission, Comment)):
if not cls.can_see(user, other.author): return False if not cls.can_see(user, other.author): return False
if user and user.id == other.author_id: return True if user and user.id == other.author_id: return True
if isinstance(other, Submission): if isinstance(other, Submission):
if other.sub and not cls.can_see(user, other.subr): return False if not (user and user.patron) and other.title.lower().startswith('[paypigs]'):
return False
if other.sub and not cls.can_see(user, other.subr):
return False
else: else:
if other.parent_submission: if other.parent_submission:
if user and user.id == other.post.author_id: return True if user and user.id == other.post.author_id: return True