fixed broken summoner_name field
This commit is contained in:
parent
2707fad57f
commit
9824add40e
|
@ -24,12 +24,16 @@ def show_match(tournament_id, match_id):
|
|||
participants = list()
|
||||
for opponent in match['opponents']:
|
||||
participant = toornament.get_participant(tournament_id, opponent['participant']['id'])
|
||||
summoner_names = list()
|
||||
for player in participant['lineup']:
|
||||
summoner_names.append(player['custom_fields']['summoner_name'])
|
||||
multilink_params = {
|
||||
'query': ','.join(summoner_names)
|
||||
}
|
||||
participant['opgg_multilink'] = urllib.parse.urlencode(multilink_params)
|
||||
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'])
|
||||
multilink_params = {
|
||||
'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)
|
||||
|
|
Loading…
Reference in New Issue