make some function names shorter

remotes/1693045480750635534/spooky-22
Aevann1 2022-08-11 06:05:23 +02:00
parent cfa17aaf68
commit 9341f2368a
8 changed files with 14 additions and 14 deletions

View File

@ -43,7 +43,7 @@ def send_verification_email(user, email=None):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def api_verify_email(v):
def verify_email(v):
send_verification_email(v)

View File

@ -1160,7 +1160,7 @@ def approve_post(post_id, v):
@app.post("/distinguish/<post_id>")
@admin_level_required(1)
def api_distinguish_post(post_id, v):
def distinguish_post(post_id, v):
post = get_post(post_id)
@ -1297,7 +1297,7 @@ def unsticky_comment(cid, v):
@app.post("/remove_comment/<c_id>")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2)
def api_remove_comment(c_id, v):
def remove_comment(c_id, v):
comment = get_comment(c_id)
if not comment:
@ -1320,7 +1320,7 @@ def api_remove_comment(c_id, v):
@app.post("/approve_comment/<c_id>")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2)
def api_approve_comment(c_id, v):
def approve_comment(c_id, v):
comment = get_comment(c_id)
if not comment: abort(404)

View File

@ -139,7 +139,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
@limiter.limit("1/second;20/minute;200/hour;1000/day")
@limiter.limit("1/second;20/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def api_comment(v):
def comment(v):
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
parent_submission = request.values.get("submission").strip()

View File

@ -8,7 +8,7 @@ from files.__main__ import app
@app.post("/vote/post/option/<option_id>")
@is_not_permabanned
def api_vote_option(option_id, v):
def vote_option(option_id, v):
option_id = int(option_id)
@ -60,7 +60,7 @@ def option_votes(option_id, v):
@app.post("/vote/comment/option/<option_id>")
@is_not_permabanned
def api_vote_option_comment(option_id, v):
def vote_option_comment(option_id, v):
option_id = int(option_id)

View File

@ -613,7 +613,7 @@ def thumbnail_thread(pid):
@app.post("/is_repost")
def api_is_repost():
def is_repost():
if not FEATURES['REPOST_DETECTION']:
return {'permalink': ''}
@ -1240,7 +1240,7 @@ def unsave_post(pid, v):
@app.post("/pin/<post_id>")
@auth_required
def api_pin_post(post_id, v):
def pin_post(post_id, v):
post = get_post(post_id)
if post:

View File

@ -10,7 +10,7 @@ from files.helpers.sanitize import filter_emojis_only
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def api_flag_post(pid, v):
def flag_post(pid, v):
post = get_post(pid)
@ -75,7 +75,7 @@ def api_flag_post(pid, v):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def api_flag_comment(cid, v):
def flag_comment(cid, v):
comment = get_comment(cid)

View File

@ -827,7 +827,7 @@ def mfa_qr(secret, v):
@app.get("/is_available/<name>")
def api_is_available(name):
def is_available(name):
name=name.strip()

View File

@ -61,7 +61,7 @@ def vote_info_get(v, link):
@limiter.limit("5/second;60/minute;1000/hour;2000/day")
@limiter.limit("5/second;60/minute;1000/hour;2000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@is_not_permabanned
def api_vote_post(post_id, new, v):
def vote_post(post_id, new, v):
if new == "-1" and DISABLE_DOWNVOTES: return {"error": "forbidden."}, 403
@ -133,7 +133,7 @@ def api_vote_post(post_id, new, v):
@limiter.limit("5/second;60/minute;1000/hour;2000/day")
@limiter.limit("5/second;60/minute;1000/hour;2000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@is_not_permabanned
def api_vote_comment(comment_id, new, v):
def vote_comment(comment_id, new, v):
if new == "-1" and DISABLE_DOWNVOTES: return {"error": "forbidden."}, 403