Skip to content

Commit 7172f84

Browse files
Merge pull request #621 from topcoder-platform/fix/timeline-template-id-handling
allow admins/m2m to change the timelineTemplateId
2 parents d5ac6a3 + 2b391ba commit 7172f84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/ChallengeService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,7 @@ 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 (!currentUser.isMachine && !hasAdminRole(currentUser) && !_.get(data, "legacy.pureV5") && !_.get(challenge, "legacy.pureV5")) {
16201621
if (!_.get(data, "legacy.pureV5") && !_.get(challenge, "legacy.pureV5")) {
16211622
if (
16221623
finalStatus !== constants.challengeStatuses.New &&
@@ -1750,7 +1751,7 @@ async function updateChallenge(currentUser, challengeId, data) {
17501751
const { track, type } = await challengeHelper.validateAndGetChallengeTypeAndTrack({
17511752
typeId: challenge.typeId,
17521753
trackId: challenge.trackId,
1753-
timelineTemplateId: challenge.timelineTemplateId,
1754+
timelineTemplateId: timelineTemplateChanged ? finalTimelineTemplateId : challenge.timelineTemplateId,
17541755
});
17551756

17561757
if (_.get(type, "isTask")) {

0 commit comments

Comments
 (0)