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

Commit e4d0836

Browse files
authored
Merge pull request #476 from appirio-tech/kohata-fix-country-check
Fix for the issue: Do not allow a member to register for challenge if country is not set
2 parents b88050e + dff6242 commit e4d0836

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

initializers/challengeHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ exports.challengeHelper = function (api, next) {
157157
}
158158

159159
if (rows[0].user_country_banned) {
160-
cb(new ForbiddenError('You cannot participate in this challenge as your country is banned.'));
160+
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.'));
161161
return;
162162
}
163163

164164
// Do not allow a member to register for challenge if country is not set
165165
if (rows[0].comp_country_is_null) {
166-
cb(new ForbiddenError('You cannot participate in this challenge as your country is not set.'));
166+
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.'));
167167
return;
168168
}
169169

queries/challenge_registration_validations

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ select
77
(ce.contest_eligibility_id IS NULL) as no_elgibility_req,
88
(ugx.login_id IS NOT NULL) as user_in_eligible_group,
99
(uax.user_id IS NOT NULL OR coder.coder_id IS NOT NULL) as user_country_banned,
10-
(coder2.comp_country_code IS NULL) as comp_country_is_null,
10+
(coder2.comp_country_code IS NULL OR coder2.comp_country_code = '') as comp_country_is_null,
1111
(cop.copilot_profile_id IS NOT NULL) as user_is_copilot,
1212
(pctl.name) as copilot_type
1313
from project p

0 commit comments

Comments
 (0)