diff --git a/CTFd/api/v1/scoreboard.py b/CTFd/api/v1/scoreboard.py index 4314d71e..f8140b9f 100644 --- a/CTFd/api/v1/scoreboard.py +++ b/CTFd/api/v1/scoreboard.py @@ -122,7 +122,6 @@ class ScoreboardDetail(Resource): awards = awards.all() # Build a mapping of accounts to their solves and awards - solves = solves + awards solves_mapper = defaultdict(list) for solve in solves: solves_mapper[solve.account_id].append( @@ -136,6 +135,18 @@ class ScoreboardDetail(Resource): } ) + for award in awards: + solves_mapper[award.account_id].append( + { + "challenge_id": None, + "account_id": award.account_id, + "team_id": award.team_id, + "user_id": award.user_id, + "value": award.value, + "date": isoformat(award.date), + } + ) + # Sort all solves by date for team_id in solves_mapper: solves_mapper[team_id] = sorted(