forked from MarseyWorld/MarseyWorld
filter properly per poll: https://rdrama.net/post/79285/-/2845495
parent
b58b506014
commit
f1275b90eb
|
@ -458,12 +458,9 @@ class User(Base):
|
||||||
|
|
||||||
posts = g.db.query(Submission.id).filter_by(author_id=self.id, is_pinned=False)
|
posts = g.db.query(Submission.id).filter_by(author_id=self.id, is_pinned=False)
|
||||||
|
|
||||||
if not (v and (v.admin_level > PERMS['POST_COMMENT_MODERATION'] or v.id == self.id)):
|
if not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or v.id == self.id)):
|
||||||
posts = posts.filter_by(is_banned=False, private=False, ghost=False)
|
posts = posts.filter_by(is_banned=False, private=False, ghost=False)
|
||||||
|
|
||||||
if not (v and v.admin_level > PERMS['POST_COMMENT_MODERATION']):
|
|
||||||
posts = posts.filter_by(deleted_utc=0)
|
|
||||||
|
|
||||||
posts = apply_time_filter(t, posts, Submission)
|
posts = apply_time_filter(t, posts, Submission)
|
||||||
|
|
||||||
posts = sort_posts(sort, posts)
|
posts = sort_posts(sort, posts)
|
||||||
|
|
|
@ -1145,12 +1145,10 @@ def u_username_comments(username, v=None):
|
||||||
comments = comments.filter(
|
comments = comments.filter(
|
||||||
Comment.is_banned == False,
|
Comment.is_banned == False,
|
||||||
Comment.ghost == False,
|
Comment.ghost == False,
|
||||||
comment_post_author.shadowbanned == None
|
comment_post_author.shadowbanned == None,
|
||||||
|
Comment.deleted_utc == 0,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not (v and v.admin_level > PERMS['POST_COMMENT_MODERATION']):
|
|
||||||
comments = comments.filter(Comment.deleted_utc == 0)
|
|
||||||
|
|
||||||
comments = apply_time_filter(t, comments, Comment)
|
comments = apply_time_filter(t, comments, Comment)
|
||||||
|
|
||||||
comments = sort_comments(sort, comments)
|
comments = sort_comments(sort, comments)
|
||||||
|
|
Loading…
Reference in New Issue