Skip to content

Commit 4198859

Browse files
authored
Merge pull request #1581 from topcoder-platform/develop
Fix bug where copilots can't assign tasks to themselves, even before activation
2 parents f9cf766 + 0760c78 commit 4198859

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/actions/challenges.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ export function updateChallengeDetails (challengeId, challengeDetails, projectId
328328
if (hasMilestone) {
329329
delete challengeDetails.milestoneId
330330
}
331+
if (challengeDetails.status === 'Completed') {
332+
// Cannot update prizeSets for challenges with status: Completed!
333+
delete challengeDetails.prizeSets
334+
}
331335
return updateChallenge(challengeId, challengeDetails).then(async challenge => {
332336
if (hasMilestone) {
333337
if (milestoneId && milestoneId !== -1) {

src/components/ChallengeEditor/index.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,15 +1576,13 @@ class ChallengeEditor extends Component {
15761576
<div className={styles.bottomContainer}>
15771577
{!isLoading && <LastSavedDisplay timeLastSaved={draftChallenge.data.updated} />}
15781578
{!isLoading && (!isActive) && (!isCompleted) && <div className={styles.buttonContainer}>
1579-
{(!preventCopilotFromActivatingTask) && (
1580-
<div className={styles.button}>
1581-
{!this.state.hasValidationErrors ? (
1582-
<PrimaryButton text={isSaving ? 'Saving...' : 'Save Draft'} type={'info'} onClick={this.createDraftHandler} />
1583-
) : (
1584-
<PrimaryButton text={'Save Draft'} type={'disabled'} />
1585-
)}
1586-
</div>
1587-
)}
1579+
<div className={styles.button}>
1580+
{!this.state.hasValidationErrors ? (
1581+
<PrimaryButton text={isSaving ? 'Saving...' : 'Save Draft'} type={'info'} onClick={this.createDraftHandler} />
1582+
) : (
1583+
<PrimaryButton text={'Save Draft'} type={'disabled'} />
1584+
)}
1585+
</div>
15881586
{
15891587
(
15901588
isDraft &&

0 commit comments

Comments
 (0)