Incorporate pyteamsnap changes

This commit is contained in:
2022-06-25 09:06:43 -05:00
parent 266ea66971
commit a15ea940a2
4 changed files with 15 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
from django.shortcuts import render
import gamechanger.models as GcModels
import gamechanger.utils.gamechanger
from gamechanger.utils.gamechanger import get_gamechanger_client
from teamsnap.models import Opponent, Team
from teamsnap.utils import get_teamsnap_client
@@ -9,7 +9,7 @@ from teamsnap.utils import get_teamsnap_client
def gamecard(request, team_id, event_id):
import re
from pyteamsnap.api import (
from pyteamsnap.objects import (
Availability,
AvailabilitySummary,
Event,
@@ -61,7 +61,8 @@ def gamecard(request, team_id, event_id):
ts_availability_lookup = {m.data["id"]: m for m in ts_availabilities}
ts_lineup_entries_lookup = {m.data["member_id"]: m for m in ts_lineup_entries}
stats = gamechanger.utils.gamechanger.stats(request)
gc_client = get_gamechanger_client(request)
stats = gc_client.get_stats()
stats_lookup = {
GcModels.Player.objects.filter(id=k).first().teamsnap_member_id: stat_row
for k, stat_row in stats.items()