forked from MarseyWorld/MarseyWorld
Make CARP_ID's flair uneditable by others.
This is a kludge solution that sticks special case logic in places it shouldn't be. However, community management demands necessitate it quickly. Of the three ways to change a flair (customtitle), this prevents using flairlocks and admin flair editing on the user with CARP_ID. Only the user himself may change his flair through settings.master
parent
b6059201c0
commit
c2266985b7
|
@ -1075,6 +1075,8 @@ def unshadowban(user_id, v):
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
def admin_title_change(user_id, v):
|
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()
|
user = g.db.query(User).filter_by(id=user_id).one_or_none()
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,9 @@ def award_thing(v, thing_type, id):
|
||||||
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
|
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
|
||||||
elif kind == "flairlock":
|
elif kind == "flairlock":
|
||||||
new_name = note[:100].replace("𒐪","")
|
new_name = note[:100].replace("𒐪","")
|
||||||
if not new_name and author.flairchanged:
|
if CARP_ID > 0 and author.id == CARP_ID:
|
||||||
|
send_repeatable_notification(v.id, "Carp's title is sacred and inviolable. You just wasted a flairlock!")
|
||||||
|
elif not new_name and author.flairchanged:
|
||||||
author.flairchanged += 86400
|
author.flairchanged += 86400
|
||||||
else:
|
else:
|
||||||
author.customtitleplain = new_name
|
author.customtitleplain = new_name
|
||||||
|
|
Loading…
Reference in New Issue