Skip to content

Commit

Permalink
Cyberleague: [premieroctet#159] Adapt users filter in computeBellweth…
Browse files Browse the repository at this point in the history
…erStatistics
  • Loading branch information
Bastien-Wappizy committed Oct 3, 2024
1 parent f03fecf commit 8256aa8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backend/web/server/plugins/cyberleague/statistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ const computeBellwetherStatistics = async (filters) => {
//Getting scores that will be used to do statistics
const companies = await Company.find(companyFilter)

//if user is not attach to a recorded company, we check its company size (TODO : and apply filters)
const users = await User.find({$or: [{company: {$in: companies.map((c) => {return c._id})}}, {company: undefined, company_size: {$lte: 5000}}]})
const users = await User.find({company: {$in: companies.map((c) => {return c._id})}})

const scores = await Score.find({creator: {$in: users.map((u) => {return u._id})}}).populate([
{path: 'answers', populate: {path:'answer'}},
Expand Down

0 comments on commit 8256aa8

Please sign in to comment.