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

Commit 672d802

Browse files
author
fireice.topcoder
committed
Merge branch 'check_eligibility_country_update'
2 parents 460df29 + 350f528 commit 672d802

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

queries/challenge_registration_validations

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ select
66
(us.user_id IS NOT NULL) as user_suspended,
77
(ce.contest_eligibility_id IS NULL) as no_elgibility_req,
88
(ugx.login_id IS NOT NULL) as user_in_eligible_group,
9-
(uax.user_id IS NOT NULL) as user_country_banned,
9+
(uax.user_id IS NOT NULL OR coder.coder_id IS NOT NULL) as user_country_banned,
1010
(cop.copilot_profile_id IS NOT NULL) as user_is_copilot,
1111
(pctl.name) as copilot_type
1212
from project p
@@ -44,6 +44,12 @@ left outer join (
4444
on uax.address_id=a.address_id
4545
and c.country_name in ( "Iran", "North Korea", "Cuba", "Sudan", "Syria" )
4646
) on uax.user_id = @userId@
47+
-- Check coder's country
48+
left outer join (
49+
informixoltp:coder coder join informixoltp:country country
50+
on coder.comp_country_code=country.country_code
51+
and country.country_name in ( "Iran", "North Korea", "Cuba", "Sudan", "Syria" )
52+
) on coder.coder_id = @userId@
4753
-- Get the copilot type
4854
left join (
4955
project_copilot_type pct join project_copilot_type_lu pctl
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DELETE FROM coder WHERE coder_id = 400013;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
INSERT INTO 'informixoltp':coder(coder_id, quote, coder_type_id, comp_country_code, display_quote, quote_location, quote_color, display_banner, banner_style)
2+
VALUES(400013, '', 2, '192', 1, 'md', '#000000', 1, 'bannerStyle1');

test/test.challengeRegistration.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ describe('Challenge Registration API', function () {
6060
},
6161
function (cb) {
6262
testHelper.runSqlFile(SQL_DIR + "common_oltp__clean", "common_oltp", cb);
63+
},
64+
function (cb) {
65+
testHelper.runSqlFile(SQL_DIR + "informixoltp__clean", "informixoltp", cb);
6366
}
6467
], done);
6568
}
@@ -77,6 +80,9 @@ describe('Challenge Registration API', function () {
7780
},
7881
function (cb) {
7982
testHelper.runSqlFile(SQL_DIR + "tcs_catalog__insert_test_data", "tcs_catalog", cb);
83+
},
84+
function (cb) {
85+
testHelper.runSqlFile(SQL_DIR + "informixoltp__insert_test_data", "informixoltp", cb);
8086
}
8187
], done);
8288
});

0 commit comments

Comments
 (0)