From dbf760c6e7390cc0de5cd57e3068f009a72cdf9f Mon Sep 17 00:00:00 2001 From: Harshal Dhumal Date: Thu, 31 Aug 2017 09:54:31 +0100 Subject: [PATCH] Improve datamodel validations for default Validator if user (developer) do not implement validate function in datamodel. Fixes #2670 --- web/pgadmin/browser/static/js/datamodel.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/pgadmin/browser/static/js/datamodel.js b/web/pgadmin/browser/static/js/datamodel.js index c7c5dd63b..9545b87f8 100644 --- a/web/pgadmin/browser/static/js/datamodel.js +++ b/web/pgadmin/browser/static/js/datamodel.js @@ -358,14 +358,15 @@ function(_, S, pgAdmin, $, Backbone) { if (!msg) { msg = self.validate(_.keys(attrs)); } + } - /* - * If any parent present, we will need to inform the parent - that - * I have some issues/fixed the issue. - * - * If not parent found, we will raise the issue - */ - if (_.size(self.errorModel.attributes) == 0) { + /* + * If any parent present, we will need to inform the parent - that + * I have some issues/fixed the issue. + * + * If not parent found, we will raise the issue + */ + if (_.size(self.errorModel.attributes) == 0) { if (self.collection || self.handler) { (self.collection || self.handler).trigger( 'pgadmin-session:model:valid', self, (self.collection || self.handler) @@ -383,7 +384,6 @@ function(_, S, pgAdmin, $, Backbone) { self.trigger('pgadmin-session:invalid', msg, self); } } - } return res; }