Skip to content

Commit b3e2480

Browse files
ci:deploying review role fix
1 parent fd8d005 commit b3e2480

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ workflows:
6767
context : org-global
6868
filters:
6969
branches:
70-
only: ['develop']
70+
only: ['issue_reviewer_role']
7171
- "build-prod":
7272
context : org-global
7373
filters:

src/common/helper.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,12 @@ function * checkCreateAccess (authUser, subEntity) {
453453
// Get phases and winner detail from challengeDetails
454454
const phases = challengeDetails.body.phases
455455

456+
// Check if the User is assigned as the reviewer for the contest
457+
const reviewers = _.filter(currUserRoles, { role: 'Reviewer' })
458+
if (reviewers.length !== 0) {
459+
throw new errors.HttpStatusError(400, `You cannot create a submission for a challenge while you are a reviewer`)
460+
}
461+
456462
// Check if the User is registered for the contest
457463
const submitters = _.filter(currUserRoles, { role: 'Submitter' })
458464
if (submitters.length === 0) {

0 commit comments

Comments
 (0)