mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Undefined check on homepage, update updateCourses.js
This commit is contained in:
parent
dc7c220b57
commit
d6d208803c
2 changed files with 6 additions and 2 deletions
|
@ -242,7 +242,7 @@ block content
|
|||
h6.course-name= i18n(course.attributes, 'name') + ':'
|
||||
p.small
|
||||
- var total = 0;
|
||||
each concept in course.get('concepts')
|
||||
each concept in course.get('concepts') || []
|
||||
- if (conceptsSeen[concept]) continue;
|
||||
- conceptsSeen[concept] = true;
|
||||
if total === 3
|
||||
|
|
|
@ -123,7 +123,11 @@ _.forEach(courses, function(course) {
|
|||
|
||||
print("Updating courses..");
|
||||
for (var i = 0; i < courses.length; i++) {
|
||||
db.courses.update({slug: courses[i].slug}, {$set: courses[i]}, {upsert: true});
|
||||
var result = db.courses.update({slug: courses[i].slug}, {$set: courses[i]});
|
||||
if (result.nMatched !== 1) {
|
||||
print("Failed to update " + courses[i].slug);
|
||||
print(JSON.stringify(result, null, 2));
|
||||
}
|
||||
}
|
||||
|
||||
print("Upserting i18n", db.courses.update(
|
||||
|
|
Loading…
Reference in a new issue