Skip to content

Commit 37b439f

Browse files
Merge pull request #117 from topcoder-platform/develop
Release fix for registrations on non-active challenges
2 parents bddbe14 + 7d2924f commit 37b439f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ install_dependency: &install_dependency
1818
install_deploysuite: &install_deploysuite
1919
name: Installation of install_deploysuite.
2020
command: |
21-
git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
21+
git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
2222
cp ./../buildscript/master_deploy.sh .
2323
cp ./../buildscript/buildenv.sh .
2424
cp ./../buildscript/awsconfiguration.sh .

src/services/ResourceService.js

+4
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ async function init (currentUser, challengeId, resource, isCreated) {
231231
throw new errors.BadRequestError('Cannot delete resources of a completed challenge!')
232232
}
233233

234+
if (!_.get(challenge, 'task.isTask', false) && _.get(challenge, 'status') !== constants.ChallengeStatuses.Active && isCreated && resource.roleId === config.SUBMITTER_RESOURCE_ROLE_ID) {
235+
throw new errors.BadRequestError(`Cannot create submitter resource on challenge with status ${_.get(challenge, 'status')}`)
236+
}
237+
234238
// Prevent from creating more than 1 submitter resources on tasks
235239
if (_.get(challenge, 'task.isTask', false) && isCreated && resource.roleId === config.SUBMITTER_RESOURCE_ROLE_ID) {
236240
const existing = await getResources(currentUser, challengeId, config.SUBMITTER_RESOURCE_ROLE_ID, null, null, 1, 1)

0 commit comments

Comments
 (0)