parent
cce51e6157
commit
c16f16d18b
7 changed files with 23 additions and 23 deletions
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue