diff options
author | rubenwardy <rw@rubenwardy.com> | 2020-07-12 23:53:20 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2020-07-12 23:53:20 +0100 |
commit | bbc89bb2c2a6b74fb36c04659dfe45e75351c58c (patch) | |
tree | 80edc02f2265129988e760ca5e13ebbf40c76873 /app/models.py | |
parent | ab58570a0c1973e1467101222a6ec6804c4fe1a1 (diff) | |
download | cheatdb-bbc89bb2c2a6b74fb36c04659dfe45e75351c58c.tar.xz |
Fix misattribution of review due to missing reply ordering
Diffstat (limited to 'app/models.py')
-rw-r--r-- | app/models.py | 5 |
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) |