forked from MarseyWorld/MarseyWorld
fix 500 error
parent
7d6e66b6f6
commit
386bfa1f3b
|
@ -208,14 +208,13 @@ class Comment(Base):
|
||||||
@lazy
|
@lazy
|
||||||
def replies(self, sort=None):
|
def replies(self, sort=None):
|
||||||
if self.replies2 != None:
|
if self.replies2 != None:
|
||||||
return [x for x in self.replies2 if not x.author.shadowbanned]
|
replies = self.replies2
|
||||||
|
elif not self.parent_submission:
|
||||||
if not self.parent_submission:
|
replies = g.db.query(Comment).filter_by(parent_comment_id=self.id).order_by(Comment.id).all()
|
||||||
return g.db.query(Comment).options(
|
else:
|
||||||
joinedload(Comment.author)
|
return self.child_comments
|
||||||
).filter_by(parent_comment_id=self.id, shadowbanned=None).order_by(Comment.id).all()
|
|
||||||
|
|
||||||
return [x for x in self.child_comments if not x.author.shadowbanned]
|
return [x for x in replies if not x.author.shadowbanned]
|
||||||
|
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
|
|
Loading…
Reference in New Issue