refactor: Refactor serialize_player function to handle empty player.personaname
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ching 2024-03-28 16:03:24 +08:00
parent 59b4ed7f03
commit adc6aaf815

View File

@ -3,7 +3,7 @@ import dota
def serialize_player(player):
friend = dota.Friend.get_or_none(steam_id=player.account_id)
player_data = {
'personaname': player.personaname,
'personaname': player.personaname if player.personaname else '',
'nickname': friend.name if friend else '',
'kills': player.kills,
'deaths': player.deaths,