fd
This commit is contained in:
parent
d2687c8338
commit
a8f8afa093
5 changed files with 5 additions and 6 deletions
|
@ -246,8 +246,9 @@ def before_request():
|
|||
@app.after_request
|
||||
def after_request(response):
|
||||
|
||||
g.db.commit()
|
||||
g.db.close()
|
||||
if g.db:
|
||||
g.db.commit()
|
||||
g.db.close()
|
||||
|
||||
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
||||
response.headers.add("Referrer-Policy", "same-origin")
|
||||
|
|
|
@ -62,7 +62,7 @@ def check_ban_evade(v):
|
|||
post.ban_reason="ban evasion"
|
||||
g.db.add(post)
|
||||
|
||||
g.db.commit()
|
||||
g.db.flush()
|
||||
|
||||
ma=ModAction(
|
||||
kind="ban_post",
|
||||
|
|
|
@ -590,7 +590,6 @@ def api_comment(v):
|
|||
|
||||
parent_post.comment_count = g.db.query(Comment).filter_by(parent_submission=parent_post.id).count()
|
||||
g.db.add(parent_post)
|
||||
g.db.commit()
|
||||
|
||||
if request.headers.get("Authorization"): return c.json
|
||||
else: return jsonify({"html": render_template("comments.html",
|
||||
|
|
|
@ -367,7 +367,7 @@ def sign_up_post(v):
|
|||
)
|
||||
|
||||
g.db.add(new_user)
|
||||
g.db.commit()
|
||||
g.db.flush()
|
||||
|
||||
# give a beta badge
|
||||
beta_badge = Badge(user_id=new_user.id,
|
||||
|
|
|
@ -270,7 +270,6 @@ def messagereply(v):
|
|||
g.db.add(new_aux)
|
||||
notif = Notification(comment_id=new_comment.id, user_id=user.id)
|
||||
g.db.add(notif)
|
||||
g.db.commit()
|
||||
cache.delete_memoized(User.notification_messages, user)
|
||||
|
||||
return jsonify({"html": render_template("comments.html",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue