From 8c50047f2082c523ad83ba537296ae53b8768d85 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 30 Aug 2022 12:14:19 -0400 Subject: [PATCH] Remove new sort on 'thread' in Submission.title. Requested by multiple jannies. Rough timeline, as I understand it: - Circa 7mo ago, this logic was originally added for threads with 'megathread' in the title. - Some time later, a checkbox on submission which sets the flag Submission.new does the same thing. - In af680d8a940e, change the check from 'megathread' to 'thread'. There must've been some reason for the change of substring checked. However, it routinely causes issues for the admins and confuses users. Solution has been to retroactively update posts that currently rely on the 'megathread' in title behavior to use the `new` flag and to remove the logic going forward. --- files/routes/posts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 171fd1c28..a5a2cc5f5 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -124,7 +124,7 @@ def post_id(pid, anything=None, v=None, sub=None): if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":"Must be 18+ to view"}, 451 return render_template("errors/nsfw.html", v=v) - if post.new or 'thread' in post.title.lower(): defaultsortingcomments = 'new' + if post.new: defaultsortingcomments = 'new' elif v: defaultsortingcomments = v.defaultsortingcomments else: defaultsortingcomments = "top" sort = request.values.get("sort", defaultsortingcomments) @@ -1071,7 +1071,7 @@ def submit_post(v, sub=None): if request.headers.get("Authorization"): return post.json else: post.voted = 1 - if post.new or 'thread' in post.title.lower(): sort = 'new' + if post.new: sort = 'new' else: sort = v.defaultsortingcomments return render_template('submission.html', v=v, p=post, sort=sort, render_replies=True, offset=0, success=True, sub=post.subr)