fdfd
This commit is contained in:
parent
fec6a7ada8
commit
f0a9947e00
6 changed files with 17 additions and 18 deletions
|
@ -55,7 +55,7 @@ def send_verification_email(user, email=None):
|
|||
|
||||
|
||||
@app.post("/verify_email")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
def api_verify_email(v):
|
||||
|
||||
send_verification_email(v)
|
||||
|
|
|
@ -12,16 +12,15 @@ def banaward_trigger(post=None, comment=None):
|
|||
author = post.author if post else comment.author
|
||||
link = f"[this post]({post.permalink})" if post else f"[this comment]({comment.permalink})"
|
||||
|
||||
if author.admin_level < 1:
|
||||
if not author.is_suspended:
|
||||
author.ban(reason="one-day ban award used", days=1)
|
||||
if not author.is_suspended:
|
||||
author.ban(reason="one-day ban award used", days=1)
|
||||
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
||||
elif author.unban_utc > 0:
|
||||
author.unban_utc += 24*60*60
|
||||
g.db.add(author)
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
||||
elif author.unban_utc > 0:
|
||||
author.unban_utc += 24*60*60
|
||||
g.db.add(author)
|
||||
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
||||
|
||||
|
||||
ACTIONS = {
|
||||
|
|
|
@ -521,7 +521,7 @@ def api_comment(v):
|
|||
|
||||
|
||||
@app.post("/edit_comment/<cid>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def edit_comment(cid, v):
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ def request_api_keys(v):
|
|||
|
||||
|
||||
@app.post("/delete_app/<aid>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def delete_oauth_app(v, aid):
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ site = environ.get("DOMAIN").strip()
|
|||
with open("snappy.txt", "r") as f: snappyquotes = f.read().split("{[para]}")
|
||||
|
||||
@app.post("/publish/<pid>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def publish(pid, v):
|
||||
post = get_post(pid)
|
||||
|
@ -224,7 +224,7 @@ def post_id(pid, anything=None, v=None):
|
|||
|
||||
|
||||
@app.post("/edit_post/<pid>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def edit_post(pid, v):
|
||||
|
||||
|
@ -345,7 +345,7 @@ def edit_post(pid, v):
|
|||
|
||||
@app.get("/submit/title")
|
||||
@limiter.limit("6/minute")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
def get_post_title(v):
|
||||
|
||||
url = request.args.get("url", None)
|
||||
|
@ -955,7 +955,7 @@ def undelete_post_pid(pid, v):
|
|||
|
||||
|
||||
@app.post("/toggle_comment_nsfw/<cid>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def toggle_comment_nsfw(cid, v):
|
||||
|
||||
|
@ -966,7 +966,7 @@ def toggle_comment_nsfw(cid, v):
|
|||
return "", 204
|
||||
|
||||
@app.post("/toggle_post_nsfw/<pid>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def toggle_post_nsfw(pid, v):
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ def admin_vote_info_get(v):
|
|||
|
||||
|
||||
@app.post("/vote/post/<post_id>/<new>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def api_vote_post(post_id, new, v):
|
||||
|
||||
|
@ -101,7 +101,7 @@ def api_vote_post(post_id, new, v):
|
|||
return "", 204
|
||||
|
||||
@app.post("/vote/comment/<comment_id>/<new>")
|
||||
@is_not_banned
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def api_vote_comment(comment_id, new, v):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue