Skip to content

Include User ID in get_standings() #35

@JDIacobbo

Description

@JDIacobbo

I think it would be very helpful to include the user id along with the user name in the function get_standing(). In my league I am finding that team names tend to be changed often through out the season so mapping to the team name would break when this happens. The user ID of the owner is static and is more reliable to map. I've worked around this by mapping the user id to the team name each run but would prefer the id be included in the return of the function.

for user in users:
    user_id = user['user_id']
    team_name = user['metadata']['team_name']
    for id in group1:
        if id == user_id:
            group1[user_id] = team_name
    for id in group2:
        if id == user_id:
            group2[user_id] = team_name
    for id in group3:
        if id == user_id:
            group3[user_id] = team_name
    for id in group4:
        if id == user_id:
            group4[user_id] = team_name

for team in standings:
    for name in group1:
        if team[0] == group1[name]:
            ...
    for name in group2:
        if team[0] == group2[name]:
            ...
    for name in group3:
        if team[0] == group3[name]:
            ...
    for name in group4:
        if team[0] == group4[name]:
            ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions