fixed broken summoner_name field

This commit is contained in:
Netali 2021-05-08 06:40:33 +02:00
parent 2707fad57f
commit 9824add40e
1 changed files with 11 additions and 7 deletions

View File

@ -24,6 +24,7 @@ def show_match(tournament_id, match_id):
participants = list()
for opponent in match['opponents']:
participant = toornament.get_participant(tournament_id, opponent['participant']['id'])
if 'summoner_name' in participant['lineup'][0]['custom_fields']:
summoner_names = list()
for player in participant['lineup']:
summoner_names.append(player['custom_fields']['summoner_name'])
@ -31,5 +32,8 @@ def show_match(tournament_id, match_id):
'query': ','.join(summoner_names)
}
participant['opgg_multilink'] = urllib.parse.urlencode(multilink_params)
else:
for idx, _ in enumerate(participant['lineup']):
participant['lineup'][idx]['custom_fields']['summoner_name'] = 'N/V'
participants.append(participant)
return render_template('match.html', match=match, participants=participants, tournament=tournament)