Fixed course_info parsing bug.

Addressed some of Christina's review comments.
This commit is contained in:
Don Mitchell
2012-12-18 14:28:53 -05:00
parent 5709ff34f5
commit 0192a04b20
3 changed files with 11 additions and 27 deletions

View File

@@ -49,7 +49,7 @@ CMS.Models.Settings.CourseDetails = Backbone.Model.extend({
if (newattrs.end_date && newattrs.enrollment_end && newattrs.end_date < newattrs.enrollment_end) {
errors.enrollment_end = "The enrollment end date cannot be after the course end date.";
}
if (newattrs.intro_video && newattrs.intro_video != this.get('intro_video')) {
if (newattrs.intro_video && newattrs.intro_video !== this.get('intro_video')) {
if (this._videokey_illegal_chars.exec(newattrs.intro_video)) {
errors.intro_video = "Key should only contain letters, numbers, _, or -";
}
@@ -71,7 +71,7 @@ CMS.Models.Settings.CourseDetails = Backbone.Model.extend({
if (_.isEmpty(newsource) && !_.isEmpty(this.get('intro_video'))) this.save({'intro_video': null});
// TODO remove all whitespace w/in string
else {
if (this.get('intro_video') != newsource) this.save('intro_video', newsource);
if (this.get('intro_video') !== newsource) this.save('intro_video', newsource);
}
return this.videosourceSample();