Merge branch 'master' into production

This commit is contained in:
phoenixeliot 2016-05-24 17:00:31 -07:00
commit 8efe61bafe
2 changed files with 10 additions and 4 deletions

View file

@ -14,7 +14,7 @@ module.exports =
instance.started = false
levels = classroom.getLevels({courseID: course.id, withoutLadderLevels: true})
for userID in instance.get('members')
instance.started = _.any levels.models, (level) ->
instance.started ||= _.any levels.models, (level) ->
return false if level.isLadder()
session = _.find classroom.sessions.models, (session) ->
session.get('creator') is userID and session.get('level').original is level.get('original')

View file

@ -145,8 +145,11 @@ function getInitialLeadStatusViaCountry(country, trialRequests) {
}
const countryCode = countryList.getCode(country);
if (countryCode) {
if (countryCode === 'NL' || countryCode === 'BE') {
return defaultEuLeadStatus;
}
if (isEuCountryCode(countryCode)) {
return highValueLead ? 'Inbound EU Auto Attempt 1 High' : 'Inbound EU Auto Attempt 1';
return highValueLead ? 'Inbound EU Auto Attempt 1 High' : defaultEuLeadStatus;
}
return defaultInternationalLeadStatus;
}
@ -170,8 +173,11 @@ function getInitialLeadStatusViaEmails(emails, trialRequests) {
if (!currentStatus || [defaultLeadStatus, defaultInternationalLeadStatus].indexOf(currentStatus) >= 0) {
// Look for a better EU match
const countryCode = getCountryCode(null, emails);
if (countryCode === 'NL' || countryCode === 'BE') {
return defaultEuLeadStatus;
}
if (isEuCountryCode(countryCode)) {
return isHighValueLead(trialRequests) ? 'Inbound EU Auto Attempt 1 High' : 'Inbound EU Auto Attempt 1';
return isHighValueLead(trialRequests) ? 'Inbound EU Auto Attempt 1 High' : defaultEuLeadStatus;
}
}
currentStatus = currentStatus ? currentStatus : defaultLeadStatus;
@ -229,7 +235,7 @@ function isUSSchoolStatus(status) {
}
function getEmailApiKey(leadStatus) {
if (leadStatus === 'Inbound EU Auto Attempt 1') return closeIoEuMailApiKey;
if (leadStatus === defaultEuLeadStatus) return closeIoEuMailApiKey;
if (closeIoMailApiKeys.length < 0) return;
return closeIoMailApiKeys[Math.floor(Math.random() * closeIoMailApiKeys.length)];
}