Merge pull request #53 from aj-m/m49-post-submission-fix

chore: strip references to 'new' prop from submissions
This commit is contained in:
Ben Rog-Wilhelm 2022-05-09 20:24:15 -05:00 committed by GitHub
commit 97eb828b30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -1016,7 +1016,6 @@ def submit_post(v, sub=None):
club=club,
author_id=v.id,
over_18=bool(request.values.get("over_18","")),
new=True, # always sort as new by default
app_id=v.client.application.id if v.client else None,
is_bot = is_bot,
url=url,
@ -1186,7 +1185,7 @@ def submit_post(v, sub=None):
if request.headers.get("Authorization"): return post.json
else:
post.voted = 1
if post.new or 'megathread' in post.title.lower(): sort = 'new'
if 'megathread' in post.title.lower(): 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)

View file

@ -99,8 +99,7 @@ CREATE TABLE public.submissions (
flair character varying(350),
stickied_utc integer,
ghost boolean DEFAULT false NOT NULL,
sub character varying(20),
new boolean
sub character varying(20)
);