Improve datamodel validations for default Validator if user (developer) do not implement validate function in datamodel. Fixes #2670

This commit is contained in:
Harshal Dhumal 2017-08-31 09:54:31 +01:00 committed by Dave Page
parent 52840d68a8
commit dbf760c6e7

View File

@ -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;
}