Amend 20b136909: string comparison bug.

Fixes logic which failed because user_id was a string which I
improperly treated as an integer for comparisons.
master
Snakes 2022-06-04 23:58:03 -04:00
parent c2266985b7
commit 0e0a8d391b
1 changed files with 3 additions and 2 deletions

View File

@ -1075,11 +1075,12 @@ def unshadowban(user_id, v):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2)
def admin_title_change(user_id, v):
if CARP_ID > 0 and user_id == CARP_ID:
abort(403)
user = g.db.query(User).filter_by(id=user_id).one_or_none()
if CARP_ID > 0 and user.id == CARP_ID:
abort(403)
new_name=request.values.get("title").strip()[:256]
user.customtitleplain=new_name