fsd
This commit is contained in:
parent
80cb579f7f
commit
1d0733522c
1 changed files with 4 additions and 2 deletions
|
@ -764,7 +764,9 @@ def thumbnail_thread(pid):
|
||||||
@auth_required
|
@auth_required
|
||||||
def submit_post(v, sub=None):
|
def submit_post(v, sub=None):
|
||||||
if not sub: sub = request.values.get("sub")
|
if not sub: sub = request.values.get("sub")
|
||||||
sub = g.db.query(Sub).filter_by(name=sub).one_or_none()
|
sub = g.db.query(Sub.name).filter_by(name=sub).one_or_none()
|
||||||
|
if sub: sub = sub[0]
|
||||||
|
else: sub = None
|
||||||
|
|
||||||
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
||||||
|
|
||||||
|
@ -1019,7 +1021,7 @@ def submit_post(v, sub=None):
|
||||||
title=title[:500],
|
title=title[:500],
|
||||||
title_html=title_html,
|
title_html=title_html,
|
||||||
created_utc=int(time.time()),
|
created_utc=int(time.time()),
|
||||||
sub=sub.name
|
sub=sub
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(new_post)
|
g.db.add(new_post)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue