remove unnecessary response code

master
Aevann 2023-09-26 18:20:43 +03:00
parent 4f227e5c8b
commit f7e4c77898
5 changed files with 11 additions and 11 deletions

View File

@ -180,7 +180,7 @@ def speak(data, v):
typing = []
return '', 204
return ''
def refresh_online():
emit("online", [online[request.referrer], muted], room=request.referrer, broadcast=True)
@ -205,7 +205,7 @@ def connect(v):
refresh_online()
emit('typing', typing[request.referrer], room=request.referrer)
return '', 204
return ''
@socketio.on('disconnect')
@auth_required_socketio
@ -225,7 +225,7 @@ def disconnect(v):
refresh_online()
return '', 204
return ''
@socketio.on('typing')
@is_not_banned_socketio
@ -239,7 +239,7 @@ def typing_indicator(data, v):
typing[request.referrer].remove(v.username)
emit('typing', typing[request.referrer], room=request.referrer, broadcast=True)
return '', 204
return ''
@socketio.on('delete')
@ -255,7 +255,7 @@ def delete(id, v):
emit('delete', id, room=request.referrer, broadcast=True)
return '', 204
return ''
def close_running_threads():

View File

@ -67,4 +67,4 @@ def error_500(e):
def allow_nsfw():
session["over_18_cookies"] = int(time.time()) + 3600
redir = request.values.get("redir", "/")
return '', 204
return ''

View File

@ -380,7 +380,7 @@ def mobile_app(v):
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
def dismiss_mobile_tip():
session["tooltip_dismissed"] = int(time.time())
return "", 204
return ''
@app.get("/transfers/<int:id>")
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)

View File

@ -1399,7 +1399,7 @@ def subscribed_posts(v, username):
@auth_required
def fp(v, fp):
if session.get("GLOBAL"):
return '', 204
return ''
v.fp = fp
users = g.db.query(User).filter(User.fp == fp, User.id != v.id).all()
@ -1416,7 +1416,7 @@ def fp(v, fp):
check_for_alts(v, include_current_session=True)
g.db.add(v)
return '', 204
return ''
@app.post("/toggle_pins/<sub>/<sort>")
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)

View File

@ -62,7 +62,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
imlazy = 0
if existing and existing.vote_type == new: return "", 204
if existing and existing.vote_type == new: return ''
if existing:
if existing.vote_type == 0 and new != 0:
imlazy = 1
@ -178,7 +178,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
target.author.pay_account('coins', coin_value)
target.author.truescore += coin_delta
return "", 204
return ''
@app.get("/votes/<link>")
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)