aboutsummaryrefslogtreecommitdiff
path: root/app/models.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-07-12 23:53:20 +0100
committerrubenwardy <rw@rubenwardy.com>2020-07-12 23:53:20 +0100
commitbbc89bb2c2a6b74fb36c04659dfe45e75351c58c (patch)
tree80edc02f2265129988e760ca5e13ebbf40c76873 /app/models.py
parentab58570a0c1973e1467101222a6ec6804c4fe1a1 (diff)
downloadcheatdb-bbc89bb2c2a6b74fb36c04659dfe45e75351c58c.tar.xz
Fix misattribution of review due to missing reply ordering
Diffstat (limited to 'app/models.py')
-rw-r--r--app/models.py5
1 files changed, 3 insertions, 2 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)