From 99c4413bd08a0a13c65f5d9ff00dd766480e6d2a Mon Sep 17 00:00:00 2001 From: cahrens Date: Mon, 10 Nov 2014 09:52:21 -0500 Subject: [PATCH] Simply check for existing text and type. --- cms/static/js/models/xblock_validation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/static/js/models/xblock_validation.js b/cms/static/js/models/xblock_validation.js index f48f593afd..3821b0fd19 100644 --- a/cms/static/js/models/xblock_validation.js +++ b/cms/static/js/models/xblock_validation.js @@ -18,10 +18,10 @@ define(["backbone", "gettext", "underscore"], function (Backbone, gettext, _) { if (!response.empty) { var summary = "summary" in response ? response.summary : {}; var messages = "messages" in response ? response.messages : []; - if (!(_.has(summary, "text")) || !summary.text) { + if (!summary.text) { summary.text = gettext("This component has validation issues."); } - if (!(_.has(summary, "type")) || !summary.type) { + if (!summary.type) { summary.type = this.WARNING; // Possible types are ERROR, WARNING, and NOT_CONFIGURED. NOT_CONFIGURED is treated as a warning. _.find(messages, function (message) {