disable queen and flairlock awards on deleted accounts

master
Aevann 2024-11-15 16:36:55 +02:00
parent db08f718df
commit 173fe441a7
1 changed files with 6 additions and 0 deletions

View File

@ -552,6 +552,9 @@ def award_thing(v, thing_type, id):
obj.unpin_parents() obj.unpin_parents()
else: obj.pinned_utc = t else: obj.pinned_utc = t
elif kind == "queen": elif kind == "queen":
if author.username.startswith('deleted~'):
stop(403, "Recipient account is deleted!")
if not author.queen: if not author.queen:
characters = list(filter(str.isalpha, author.username)) characters = list(filter(str.isalpha, author.username))
if characters: if characters:
@ -610,6 +613,9 @@ def award_thing(v, thing_type, id):
obj.chudded = True obj.chudded = True
complies_with_chud(obj) complies_with_chud(obj)
elif kind == "flairlock": elif kind == "flairlock":
if author.username.startswith('deleted~'):
stop(403, "Recipient account is deleted!")
new_flair = note new_flair = note
if len(new_flair) > 100: if len(new_flair) > 100: