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

Commit f8c0909

Browse files
committed
Merge pull request #430 from appirio-tech/SUP-612-fix-inactive-users-can-register
Sup 612 fix inactive users can register
2 parents b3e1f7c + c7656f2 commit f8c0909

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

actions/challengeRegistration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ exports.registerChallenge = {
874874
var fail = err || inactive;
875875
if (fail) cb(fail);
876876
else api.dataAccess.executeQuery('check_challenge_exists', {challengeId: challengeId}, connection.dbConnectionMap, cb);
877-
});
877+
}, "You must activate your account in order to participate. Please check your e-mail in order to complete the activation process, or contact support@topcoder.com if you did not receive an e-mail.");
878878
}
879879
}, function (result, cb) {
880880
if (result.length > 0) {

initializers/helper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ helper.checkUserExists = function (handle, api, dbConnectionMap, callback) {
16251625
* @param {Object} dbConnectionMap - the database connection map
16261626
* @param {Function<err>} callback - the callback function
16271627
*/
1628-
helper.checkUserActivated = function (handle, api, dbConnectionMap, callback) {
1628+
helper.checkUserActivated = function (handle, api, dbConnectionMap, callback, textResponse) {
16291629
api.dataAccess.executeQuery('check_user_activated', { handle: handle }, dbConnectionMap, function (err, result) {
16301630
if (err) {
16311631
callback(err, null);
@@ -1634,7 +1634,8 @@ helper.checkUserActivated = function (handle, api, dbConnectionMap, callback) {
16341634
if (result && result[0] && result[0].status === 'A') {
16351635
callback(err, null);
16361636
} else {
1637-
callback(err, new BadRequestError('User is not activated.'));
1637+
var message = textResponse || 'User is not activated.';
1638+
callback(err, new BadRequestError(message));
16381639
}
16391640
});
16401641
};

0 commit comments

Comments
 (0)