Fix misattribution of review due to missing reply ordering

This commit is contained in:
rubenwardy
2020-07-12 23:53:20 +01:00
parent ab58570a0c
commit bbc89bb2c2
2 changed files with 7 additions and 6 deletions

View File

@@ -1101,10 +1101,11 @@ class Thread(db.Model):
created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow)
replies = db.relationship("ThreadReply", backref="thread", lazy="dynamic")
replies = db.relationship("ThreadReply", backref="thread", lazy="dynamic", \
order_by=db.asc("thread_reply_id"))
watchers = db.relationship("User", secondary=watchers, lazy="subquery", \
backref=db.backref("watching", lazy=True))
backref=db.backref("watching", lazy=True))
def getViewURL(self):
return url_for("threads.view", id=self.id)