Skip to content

Commit

Permalink
fixed handling of managers for ESPN public leagues
Browse files Browse the repository at this point in the history
  • Loading branch information
uberfastman committed Oct 9, 2024
1 parent 0bc9908 commit 3457a0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
services:

app:
image: ghcr.io/uberfastman/fantasy-football-metrics-weekly-report:19.0.2
image: ghcr.io/uberfastman/fantasy-football-metrics-weekly-report:19.0.3
platform: linux/amd64
ports:
- "5001:5000"
Expand Down
11 changes: 9 additions & 2 deletions dao/platforms/espn.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,15 @@ def map_data_to_base(self):

base_manager.manager_id = manager["id"]
base_manager.email = None
base_manager.name = re.sub(r"\W+", " ", f"{manager['firstName']} {manager['lastName']}")
base_manager.nickname = manager["displayName"]
manager_first_name = manager.get(
"firstName",
f"Manager {matchup_team.team_id}"
)
manager_last_name = manager.get("lastName", "")
base_manager.name = re.sub(
r"\W+", " ", f"{manager_first_name} {manager_last_name}"
).strip()
base_manager.nickname = manager.get("displayName", None)

base_team.managers.append(base_manager)

Expand Down

0 comments on commit 3457a0d

Please sign in to comment.