try get
This commit is contained in:
+4
-4
@@ -36,8 +36,8 @@ def fetch_data():
|
|||||||
"abbr_name": f"{player['first_name'][0]}. {player['last_name']}",
|
"abbr_name": f"{player['first_name'][0]}. {player['last_name']}",
|
||||||
"position": player['position'],
|
"position": player['position'],
|
||||||
"team": player['team'],
|
"team": player['team'],
|
||||||
"injury_status": player['injury_status'],
|
"injury_status": player.get('injury_status'),
|
||||||
"injury_body_part": player['injury_body_part']
|
"injury_body_part": player.get('injury_body_part')
|
||||||
})
|
})
|
||||||
for player in data["team2"]["players"]:
|
for player in data["team2"]["players"]:
|
||||||
print(player)
|
print(player)
|
||||||
@@ -47,8 +47,8 @@ def fetch_data():
|
|||||||
"abbr_name": f"{player['first_name'][0]}. {player['last_name']}",
|
"abbr_name": f"{player['first_name'][0]}. {player['last_name']}",
|
||||||
"position": player['position'],
|
"position": player['position'],
|
||||||
"team": player['team'],
|
"team": player['team'],
|
||||||
"injury_status": player['injury_status'],
|
"injury_status": player.get('injury_status'),
|
||||||
"injury_body_part": player['injury_body_part']
|
"injury_body_part": player.get('injury_body_part')
|
||||||
})
|
})
|
||||||
|
|
||||||
return players
|
return players
|
||||||
|
|||||||
Reference in New Issue
Block a user