Enable JL2 viewing shadowbanned comments.
parent
7915eb8390
commit
acde2c856b
|
@ -75,7 +75,7 @@ class Comment(Base):
|
|||
@lazy
|
||||
def flags(self, v):
|
||||
flags = g.db.query(CommentFlag).filter_by(comment_id=self.id).order_by(CommentFlag.created_utc).all()
|
||||
if not (v and (v.shadowbanned or v.admin_level > 2)):
|
||||
if not (v and (v.shadowbanned or v.admin_level >= 2)):
|
||||
for flag in flags:
|
||||
if flag.user.shadowbanned:
|
||||
flags.remove(flag)
|
||||
|
|
|
@ -79,7 +79,7 @@ class Submission(Base):
|
|||
@lazy
|
||||
def flags(self, v):
|
||||
flags = g.db.query(Flag).filter_by(post_id=self.id).order_by(Flag.created_utc).all()
|
||||
if not (v and (v.shadowbanned or v.admin_level > 2)):
|
||||
if not (v and (v.shadowbanned or v.admin_level >= 2)):
|
||||
for flag in flags:
|
||||
if flag.user.shadowbanned:
|
||||
flags.remove(flag)
|
||||
|
|
|
@ -561,8 +561,8 @@ class User(Base):
|
|||
'bannerurl': self.banner_url,
|
||||
'bio_html': self.bio_html_eager,
|
||||
'coins': self.coins,
|
||||
'post_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level > 2)) else self.post_count,
|
||||
'comment_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level > 2)) else self.comment_count,
|
||||
'post_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level >= 2)) else self.post_count,
|
||||
'comment_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level >= 2)) else self.comment_count,
|
||||
'badges': [x.path for x in self.badges],
|
||||
}
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ def get_comments(cids, v=None, load_parent=False):
|
|||
blocked.c.target_id,
|
||||
).filter(Comment.id.in_(cids))
|
||||
|
||||
if not (v and (v.shadowbanned or v.admin_level > 2)):
|
||||
if not (v and (v.shadowbanned or v.admin_level >= 2)):
|
||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||
|
||||
comments = comments.join(
|
||||
|
|
|
@ -128,7 +128,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
|||
blocked.c.target_id,
|
||||
)
|
||||
|
||||
if not (v and v.shadowbanned) and not (v and v.admin_level > 2):
|
||||
if not (v and v.shadowbanned) and not (v and v.admin_level >= 2):
|
||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||
|
||||
comments=comments.filter(
|
||||
|
|
|
@ -166,7 +166,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
|||
blocked.c.target_id,
|
||||
)
|
||||
|
||||
if not (v and v.shadowbanned) and not (v and v.admin_level > 2):
|
||||
if not (v and v.shadowbanned) and not (v and v.admin_level >= 2):
|
||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||
|
||||
comments=comments.filter(Comment.parent_submission == post.id, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID))).join(
|
||||
|
@ -297,7 +297,7 @@ def viewmore(v, pid, sort, offset):
|
|||
blocked.c.target_id,
|
||||
).filter(Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), Comment.stickied == None, Comment.id.notin_(ids))
|
||||
|
||||
if not (v and v.shadowbanned) and not (v and v.admin_level > 2):
|
||||
if not (v and v.shadowbanned) and not (v and v.admin_level >= 2):
|
||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||
|
||||
comments=comments.join(
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
{% set downs=c.downvotes %}
|
||||
{% set score=ups-downs %}
|
||||
|
||||
{% if v and (v.shadowbanned or v.admin_level > 2) %}
|
||||
{% if v and (v.shadowbanned or v.admin_level >= 2) %}
|
||||
{% set replies=c.replies3 %}
|
||||
{% else %}
|
||||
{% set replies=c.replies %}
|
||||
|
|
Loading…
Reference in New Issue