Skip to content

Commit

Permalink
Omit non-competitors from contest user results
Browse files Browse the repository at this point in the history
  • Loading branch information
etousley committed Sep 5, 2017
1 parent 425506d commit 9ea0c8c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion controllers/contest.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,15 @@ getContestResults = (callback) => {
}

// Loop through complete user (userTeam) dictionary
for ( let userEmail of Object.keys(userTeams) ) {
for ( let userEmail of Object.keys(contest.users) ) {
let userTeamInfo = userTeams[userEmail];

// Omit non-competitors
if (!userTeamInfo.isCompetitor) {
delete contest.users[userEmail];
continue;
}

Object.assign(contest.users[userEmail], {"points": 0});

// Get user points for this contest; update user + team contest results
Expand Down

0 comments on commit 9ea0c8c

Please sign in to comment.