fix incorrect logging in name approval

This commit is contained in:
Aaron Kimbre 2022-06-06 23:09:42 -05:00
parent a5ea052027
commit 34302006a9

View File

@ -30,14 +30,20 @@ def approve_name(id, action):
character = CharacterInfo.query.filter(CharacterInfo.id == id).first() character = CharacterInfo.query.filter(CharacterInfo.id == id).first()
if action == "approve": if action == "approve":
if character.pending_name:
character.name = character.pending_name
character.pending_name = ""
log_audit(f"Approved ({character.id}){character.pending_name} from {character.name}") log_audit(f"Approved ({character.id}){character.pending_name} from {character.name}")
flash( flash(
f"Approved ({character.id}){character.pending_name} from {character.name}", f"Approved ({character.id}){character.pending_name} from {character.name}",
"success" "success"
) )
if character.pending_name: else:
character.name = character.pending_name log_audit("Cannot make character name empty")
character.pending_name = "" flash(
"Cannot make character name empty",
"danger"
)
character.needs_rename = False character.needs_rename = False
elif action == "rename": elif action == "rename":