Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update user.py to manage new chip API on fpl #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions fpl/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,13 @@ def _get_transfer_payload(
self, players_out, players_in, user_team, players, wildcard,
free_hit):
"""Returns the payload needed to make the desired transfers."""
if wildcard:
chip='wildcard'
elif free_hit:
chip='freehit'
else:
chip=None

event = 0
if (self.current_event):
event = self.current_event
Expand All @@ -519,8 +526,7 @@ def _get_transfer_payload(
"entry": self.id,
"event": event + 1,
"transfers": [],
"wildcard": wildcard,
"freehit": free_hit
"chip": chip
}

for player_out_id, player_in_id in zip(players_out, players_in):
Expand Down