diff --git a/files/classes/comment.py b/files/classes/comment.py index 3aeeafa29..44426339f 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -228,11 +228,11 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing): @property def is_blocking(self): - return self.__dict__.get('_is_blocking', 0) + return self.__dict__.get('is_blocking', 0) @property def is_blocked(self): - return self.__dict__.get('_is_blocked', 0) + return self.__dict__.get('is_blocked', 0) @property def body(self): diff --git a/files/classes/submission.py b/files/classes/submission.py index c7bcc740b..56ca7bc63 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -386,11 +386,11 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): @property def is_blocked(self): - return self.__dict__.get('_is_blocked', False) + return self.__dict__.get('is_blocked', False) @property def is_blocking(self): - return self.__dict__.get('_is_blocking', False) + return self.__dict__.get('is_blocking', False) #@property #def award_count(self): diff --git a/files/classes/user.py b/files/classes/user.py index d57d6a1b3..382b78136 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -535,11 +535,11 @@ class User(Base, Stndrd, Age_times): @property def is_blocking(self): - return self.__dict__.get('_is_blocking', 0) + return self.__dict__.get('is_blocking', 0) @property def is_blocked(self): - return self.__dict__.get('_is_blocked', 0) + return self.__dict__.get('is_blocked', 0) def refresh_selfset_badges(self): diff --git a/files/helpers/get.py b/files/helpers/get.py index b741dbbc1..8b8396ce3 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -36,8 +36,8 @@ def get_user(username, v=None, graceful=False): ) ).first() - user._is_blocking = block and block.user_id == v.id - user._is_blocked = block and block.target_id == v.id + user.is_blocking = block and block.user_id == v.id + user.is_blocked = block and block.target_id == v.id return user @@ -64,8 +64,8 @@ def get_account(id, v=None): ) ).first() - user._is_blocking = block and block.user_id == v.id - user._is_blocked = block and block.target_id == v.id + user.is_blocking = block and block.user_id == v.id + user.is_blocked = block and block.target_id == v.id return user @@ -102,7 +102,7 @@ def get_post(i, v=None, graceful=False, **kwargs): abort(404) x = items[0] x.voted = items[1] or 0 - x._is_blocking = items[2] or 0 + x.is_blocking = items[2] or 0 else: items = g.db.query( Submission @@ -152,8 +152,8 @@ def get_posts(pids, v=None): output = [p[0] for p in query] for i in range(len(output)): output[i].voted = query[i][1] or 0 - output[i]._is_blocking = query[i][2] or 0 - output[i]._is_blocked = query[i][3] or 0 + output[i].is_blocking = query[i][2] or 0 + output[i].is_blocked = query[i][3] or 0 else: output = g.db.query(Submission,).filter(Submission.id.in_(pids)).all() @@ -181,8 +181,8 @@ def get_comment(i, v=None, graceful=False, **kwargs): vts = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id) vt = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).first() - comment._is_blocking = block and block.user_id == v.id - comment._is_blocked = block and block.target_id == v.id + comment.is_blocking = block and block.user_id == v.id + comment.is_blocked = block and block.target_id == v.id comment.voted = vt.vote_type if vt else 0 else: @@ -231,8 +231,8 @@ def get_comments(cids, v=None, load_parent=False): comment = c[0] if comment.author and comment.author.shadowbanned and not (v and v.id == comment.author_id): continue comment.voted = c[1] or 0 - comment._is_blocking = c[2] or 0 - comment._is_blocked = c[3] or 0 + comment.is_blocking = c[2] or 0 + comment.is_blocked = c[3] or 0 output.append(comment) else: diff --git a/files/routes/comments.py b/files/routes/comments.py index 853294fa7..3e3ae6d9e 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -117,8 +117,8 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None): comment = c[0] if comment.author and comment.author.shadowbanned and not (v and v.id == comment.author_id): continue comment.voted = c[1] or 0 - comment._is_blocking = c[2] or 0 - comment._is_blocked = c[3] or 0 + comment.is_blocking = c[2] or 0 + comment.is_blocked = c[3] or 0 if request.headers.get("Authorization"): return top_comment.json else: return post.rendered_page(v=v, sort=sort, comment=top_comment, comment_info=comment_info) diff --git a/files/routes/front.py b/files/routes/front.py index 624aa29c2..3bd55f416 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -67,8 +67,8 @@ def notifications(v): listing = [] for c in comments: - c._is_blocked = False - c._is_blocking = False + c.is_blocked = False + c.is_blocking = False if c.parent_submission and c.parent_comment and c.parent_comment.author_id == v.id: c.replies = [] while c.parent_comment and c.parent_comment.author_id == v.id: diff --git a/files/routes/posts.py b/files/routes/posts.py index c426314c2..22e5b9678 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -136,8 +136,8 @@ def post_id(pid, anything=None, v=None): comment = c[0] if comment.author and comment.author.shadowbanned and not (v and v.id == comment.author_id): continue comment.voted = c[1] or 0 - comment._is_blocking = c[2] or 0 - comment._is_blocked = c[3] or 0 + comment.is_blocking = c[2] or 0 + comment.is_blocked = c[3] or 0 output.append(comment) post.preloaded_comments = output