From bbc89bb2c2a6b74fb36c04659dfe45e75351c58c Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 12 Jul 2020 23:53:20 +0100 Subject: [PATCH] Fix misattribution of review due to missing reply ordering --- app/models.py | 5 +++-- app/templates/macros/reviews.html | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/models.py b/app/models.py index 3e71c75..ade4083 100644 --- a/app/models.py +++ b/app/models.py @@ -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) diff --git a/app/templates/macros/reviews.html b/app/templates/macros/reviews.html index 42ae614..6ba176c 100644 --- a/app/templates/macros/reviews.html +++ b/app/templates/macros/reviews.html @@ -19,14 +19,14 @@