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

Sup 612 fix inactive users can register #430

Merged
merged 2 commits into from
May 28, 2015
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
2 changes: 1 addition & 1 deletion actions/challengeRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ exports.registerChallenge = {
var fail = err || inactive;
if (fail) cb(fail);
else api.dataAccess.executeQuery('check_challenge_exists', {challengeId: challengeId}, connection.dbConnectionMap, cb);
});
}, "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.");
}
}, function (result, cb) {
if (result.length > 0) {
Expand Down
5 changes: 3 additions & 2 deletions initializers/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ helper.checkUserExists = function (handle, api, dbConnectionMap, callback) {
* @param {Object} dbConnectionMap - the database connection map
* @param {Function<err>} callback - the callback function
*/
helper.checkUserActivated = function (handle, api, dbConnectionMap, callback) {
helper.checkUserActivated = function (handle, api, dbConnectionMap, callback, textResponse) {
api.dataAccess.executeQuery('check_user_activated', { handle: handle }, dbConnectionMap, function (err, result) {
if (err) {
callback(err, null);
Expand All @@ -1634,7 +1634,8 @@ helper.checkUserActivated = function (handle, api, dbConnectionMap, callback) {
if (result && result[0] && result[0].status === 'A') {
callback(err, null);
} else {
callback(err, new BadRequestError('User is not activated.'));
var message = textResponse || 'User is not activated.';
callback(err, new BadRequestError(message));
}
});
};
Expand Down