From 2feb8b40c36416d55460709145d99dffdd04c369 Mon Sep 17 00:00:00 2001 From: eisbilir Date: Tue, 26 Sep 2023 13:28:15 +0300 Subject: [PATCH] fix: challenge helper method --- .circleci/config.yml | 2 +- src/common/challenge-helper.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 990cc8d7..f01686dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -90,7 +90,7 @@ workflows: branches: only: - dev - - feature/phase-advance + - PLAT-3368 - "build-qa": context: org-global diff --git a/src/common/challenge-helper.js b/src/common/challenge-helper.js index 1c509398..5fc956fc 100644 --- a/src/common/challenge-helper.js +++ b/src/common/challenge-helper.js @@ -101,7 +101,7 @@ class ChallengeHelper { await helper.ensureAccessibleByGroupsAccess(currentUser, challenge); if (challenge.constraints) { - await this.validateChallengeConstraints(challenge.constraints); + await ChallengeHelper.validateChallengeConstraints(challenge.constraints); } } @@ -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,