Skip to content

fix: challenge helper method [skip ci] #653

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

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ workflows:
branches:
only:
- dev
- feature/phase-advance
- PLAT-3368

- "build-qa":
context: org-global
Expand Down
10 changes: 5 additions & 5 deletions src/common/challenge-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ChallengeHelper {
await helper.ensureAccessibleByGroupsAccess(currentUser, challenge);

if (challenge.constraints) {
await this.validateChallengeConstraints(challenge.constraints);
await ChallengeHelper.validateChallengeConstraints(challenge.constraints);
}
}

Expand Down Expand Up @@ -202,17 +202,17 @@ class ChallengeHelper {
}

if (data.constraints) {
await this.validateChallengeConstraints(data.constraints);
await ChallengeHelper.validateChallengeConstraints(data.constraints);
}
}

async validateChallengeConstraints(constraints) {
static async validateChallengeConstraints(constraints) {
if (!_.isEmpty(constraints.allowedRegistrants)) {
await this.validateAllowedRegistrants(constraints.allowedRegistrants);
await ChallengeHelper.validateAllowedRegistrants(constraints.allowedRegistrants);
}
}

async validateAllowedRegistrants(allowedRegistrants) {
static async validateAllowedRegistrants(allowedRegistrants) {
const members = await helper.getMembersByHandles(allowedRegistrants);
const incorrectHandles = _.difference(
allowedRegistrants,
Expand Down