Skip to content

Commit d5ac6a3

Browse files
Merge pull request #620 from topcoder-platform/hotfix/temporaily-disable-templateId-check
remove temp fix
2 parents d4e82ee + 5ca159b commit d5ac6a3

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/services/ChallengeService.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,17 +1617,16 @@ async function updateChallenge(currentUser, challengeId, data) {
16171617
const finalStatus = data.status || challenge.status;
16181618
const finalTimelineTemplateId = data.timelineTemplateId || challenge.timelineTemplateId;
16191619
let timelineTemplateChanged = false;
1620-
// if (!_.get(data, "legacy.pureV5") && !_.get(challenge, "legacy.pureV5")) {
1621-
// if (
1622-
// finalStatus !== constants.challengeStatuses.New &&
1623-
// finalTimelineTemplateId !== challenge.timelineTemplateId
1624-
// ) {
1625-
// throw new errors.BadRequestError(
1626-
// `Cannot change the timelineTemplateId for challenges with status: ${finalStatus}`
1627-
// );
1628-
// }
1629-
// } else
1630-
if (finalTimelineTemplateId !== challenge.timelineTemplateId) {
1620+
if (!_.get(data, "legacy.pureV5") && !_.get(challenge, "legacy.pureV5")) {
1621+
if (
1622+
finalStatus !== constants.challengeStatuses.New &&
1623+
finalTimelineTemplateId !== challenge.timelineTemplateId
1624+
) {
1625+
throw new errors.BadRequestError(
1626+
`Cannot change the timelineTemplateId for challenges with status: ${finalStatus}`
1627+
);
1628+
}
1629+
} else if (finalTimelineTemplateId !== challenge.timelineTemplateId) {
16311630
// make sure there are no previous phases if the timeline template has changed
16321631
challenge.phases = [];
16331632
timelineTemplateChanged = true;

0 commit comments

Comments
 (0)