Skip to content

Commit a87b1c8

Browse files
authored
Merge pull request #57 from topcoder-platform/develop
HOTFIX to PROD - Ignore reviewer array checks when activating Tasks
2 parents eb775f9 + 5cb0b05 commit a87b1c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/services/ChallengeService.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,13 +2710,17 @@ async function updateChallenge(currentUser, challengeId, data, options = {}) {
27102710
logger.info(`${challengeId} is not a pureV5 challenge or has no winners set yet.`);
27112711
}
27122712

2713+
const finalTypeId = data.typeId || challenge.typeId;
2714+
const finalTrackId = data.trackId || challenge.trackId;
27132715
const { track, type } = await challengeHelper.validateAndGetChallengeTypeAndTrack({
2714-
typeId: challenge.typeId,
2715-
trackId: challenge.trackId,
2716+
typeId: finalTypeId,
2717+
trackId: finalTrackId,
27162718
timelineTemplateId: timelineTemplateChanged
27172719
? finalTimelineTemplateId
27182720
: challenge.timelineTemplateId,
27192721
});
2722+
const isStandardTaskType =
2723+
_.isString(_.get(type, "name")) && _.get(type, "name").trim().toLowerCase() === "task";
27202724

27212725
if (_.get(type, "isTask")) {
27222726
if (!_.isEmpty(_.get(data, "task.memberId"))) {
@@ -2809,6 +2813,7 @@ async function updateChallenge(currentUser, challengeId, data, options = {}) {
28092813

28102814
if (
28112815
isStatusChangingToActive &&
2816+
!isStandardTaskType &&
28122817
(challenge.status === ChallengeStatusEnum.NEW || challenge.status === ChallengeStatusEnum.DRAFT)
28132818
) {
28142819
const effectiveReviewers = Array.isArray(data.reviewers)

0 commit comments

Comments
 (0)