Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Fix for the issue: Do not allow a member to register for challenge if country is not set #476

Merged
merged 1 commit into from
Aug 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions initializers/challengeHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ exports.challengeHelper = function (api, next) {
}

if (rows[0].user_country_banned) {
cb(new ForbiddenError('You cannot participate in this challenge as your country is banned.'));
cb(new ForbiddenError('You are not eligible to participate in this challenge because of your country of residence. Please see our terms of service for more information.'));
return;
}

// Do not allow a member to register for challenge if country is not set
if (rows[0].comp_country_is_null) {
cb(new ForbiddenError('You cannot participate in this challenge as your country is not set.'));
cb(new ForbiddenError('You are not eligible to participate in this challenge because you have not specified your country of residence. Please go to your Settings and enter a country. Please see our terms of service for more information.'));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion queries/challenge_registration_validations
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ select
(ce.contest_eligibility_id IS NULL) as no_elgibility_req,
(ugx.login_id IS NOT NULL) as user_in_eligible_group,
(uax.user_id IS NOT NULL OR coder.coder_id IS NOT NULL) as user_country_banned,
(coder2.comp_country_code IS NULL) as comp_country_is_null,
(coder2.comp_country_code IS NULL OR coder2.comp_country_code = '') as comp_country_is_null,
(cop.copilot_profile_id IS NOT NULL) as user_is_copilot,
(pctl.name) as copilot_type
from project p
Expand Down