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":
log_audit(f"Approved ({character.id}){character.pending_name} from {character.name}")
flash(
f"Approved ({character.id}){character.pending_name} from {character.name}",
"success"
)
if character.pending_name: if character.pending_name:
character.name = character.pending_name character.name = character.pending_name
character.pending_name = "" character.pending_name = ""
log_audit(f"Approved ({character.id}){character.pending_name} from {character.name}")
flash(
f"Approved ({character.id}){character.pending_name} from {character.name}",
"success"
)
else:
log_audit("Cannot make character name empty")
flash(
"Cannot make character name empty",
"danger"
)
character.needs_rename = False character.needs_rename = False
elif action == "rename": elif action == "rename":