Hi,

Please find minor patch to improve datamodel validations for default
Validator if user (developer) do not implement validate function in
datamodel.
Without this default validation error messages  were suppressing if no
validation function was provided.

-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/static/js/datamodel.js b/web/pgadmin/browser/static/js/datamodel.js
index c7c5dd6..dfc803f 100644
--- a/web/pgadmin/browser/static/js/datamodel.js
+++ b/web/pgadmin/browser/static/js/datamodel.js
@@ -358,14 +358,14 @@ 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 +383,6 @@ function(_, S, pgAdmin, $, Backbone) {
                 self.trigger('pgadmin-session:invalid', msg, self);
               }
             }
-          }
 
           return res;
         }

Reply via email to