-
Notifications
You must be signed in to change notification settings - Fork 0
TIG-54: Update leaderboard with Full Name (Class Year) instead of netid of players #9
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
base: main
Are you sure you want to change the base?
Conversation
yubimamiya
commented
Nov 4, 2025
- Update add player code and User database to save information on each player's full name and class year in the User Database during CAS authentication
- Change top player functions to return Full Name (Class Year) instead of netid for players so that this is reflected in leader board of TigerSpot UI
- I was unable to test the full app due to local machine issues so please test with full app before deploying
…ON of user information and update app.py to parse JSON user_info correctly for username
…layers and insert_player function to include display_name and year
…ctions to return display_name with year instead of username (with the same json name of username)
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # YUBI, ASK: does users return the whole row of information including display name and year? | ||
|
|
||
| for user in users: | ||
| player_stats = {"username": user.username, "points": user.points} | ||
| # YUBI: replace username with display name and year | ||
| # Keep reference as username, but want to change this to name later | ||
| player_stats = {"username": user.display_name + " (" + user.year + ")", "points": user.points} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against null display_name/year when formatting leaderboard names
In the total leaderboard, get_top_players now returns user.display_name + " (" + user.year + ")". Existing users rows created before this migration have NULL values in the new columns because insert_player skips updates for existing users, so concatenation raises TypeError: can only concatenate str (not "NoneType"). Any legacy account appearing in the leaderboard will crash the view until its record is manually updated. Consider backfilling or defaulting missing fields before concatenation.
Useful? React with 👍 / 👎.
| for user in users: | ||
| player_stats = {"username": user.username, "points": user.points} | ||
| # YUBI: update player_stats to show display_name concatenated with year | ||
| # I have replaced username with the name, but kept the json reference as username for now | ||
| player_stats = {"username": user.display_name + " (" + user.year + ")", "points": user.points} | ||
| daily_top_players.append(player_stats) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Daily leaderboard also concatenates potentially null display metadata
get_daily_top_players builds player_stats using user.display_name + " (" + user.year + ")". Older usersdaily entries created before this migration never populate these new columns—the migration adds nullable fields and insert_player_daily returns immediately when a record already exists—so the code will hit the same TypeError for any legacy daily record, breaking /leaderboard until data is cleaned. Use null-safe defaults or populate the fields when upgrading existing rows.
Useful? React with 👍 / 👎.
Ammaar-Alam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see codex comments
joshuamotoaki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The display_name doesn't appear to be working (it just gives me back my netid). I'd really make sure to run this locally, ask @joshuamotoaki if you need help.
Edge case that needs to be considered -- a lot of users are already in the database. These users need to be updated when they log in again to add the display_name + year. If a user is already signed in, if these don't exist in the session, you might need to force a re-auth (ideally, you don't need to force a sign out, but if this is what's necessary then it's necessary).
played around with it a little and was able to get it to atl populate names, can push if necessary but @yubimamiya or @joshuamotoaki should be able to takeover; codex found the problems as:
so to get it working i had to:
TLDR ish
Changes Needed
Why This Works
Test Plan
|
b1cf4b9 to
76b4ad8
Compare

