From 739f873fff309d03f9d843f6bf27212a50b729c6 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 23 Sep 2021 01:52:18 +0200 Subject: [PATCH] fds --- files/classes/comment.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 9a3f7b790..ccacfba99 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -18,7 +18,7 @@ class CommentAux(Base): key_id = Column(Integer, primary_key=True) id = Column(Integer, ForeignKey("comments.id")) - body = Column(String(10000)) + body = Column(String(10000), default=None) body_html = Column(String(20000)) ban_reason = Column(String(256), default='') @@ -28,7 +28,7 @@ class Comment(Base): __tablename__ = "comments" id = Column(Integer, primary_key=True) - comment_aux = relationship("CommentAux", uselist=False, primaryjoin="Comment.id==CommentAux.id") + comment_aux = relationship("CommentAux", lazy="joined", uselist=False, innerjoin=True, primaryjoin="Comment.id==CommentAux.id") author_id = Column(Integer, ForeignKey("users.id")) parent_submission = Column(Integer, ForeignKey("submissions.id")) created_utc = Column(Integer, default=0) @@ -349,10 +349,6 @@ class Comment(Base): self.comment_aux.ban_reason = x g.db.add(self.comment_aux) - #@property - #def award_count(self): - #return len(self.awards) - @lazy def collapse_for_user(self, v):