public inbox for [email protected]  
help / color / mirror / Atom feed
From: Seçkin Alan <[email protected]>
To: [email protected]
Subject: Re: pgadmin4 new server host rule is missing
Date: Thu, 14 Apr 2016 23:46:24 +0300
Message-ID: <CAJZJJmoMC0C_hBdP4ypv99-QKNOPrw=YS5L0iKsN5d8N0mAf-A@mail.gmail.com> (raw)
In-Reply-To: <CAJZJJmpTMxG8W4S9TYp8fttbp4bwgTgmr9xGAC8LF0bBXkJn4Q@mail.gmail.com>
References: <CAJZJJmpTMxG8W4S9TYp8fttbp4bwgTgmr9xGAC8LF0bBXkJn4Q@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

++
change node js

full patch is attached

On Thu, Apr 14, 2016 at 11:18 PM, Seçkin Alan <[email protected]> wrote:
> Hi,
> In model Server.host field is nullable=False but, UI Hostname/address
> field can accept null value.
> So,
> When I click save button, in that time throw error like NOT NULL
> constraint failed: server.host .
>
> --
> Seçkin ALAN
> http://sckn.org



-- 
Seçkin ALAN
http://sckn.org


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [text/x-patch] servers_js_node_js.patch (1.5K, 2-servers_js_node_js.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
index 32e9399..ed9b7dc 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
+++ b/web/pgadmin/browser/server_groups/servers/templates/servers/servers.js
@@ -215,6 +215,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
             err['name'] = '{{ _('Name can be empty!') }}';
             errmsg = errmsg || err['name'];
           }
+          if (_.isUndefined(this.get('host')) ||this.get('host') == null || String(this.get('host')).replace(/^\s+|\s+$/g, '') == '') {
+            err['host'] = '{{ _('Host can be empty!') }}';
+            errmsg = errmsg || err['host'];
+          }
+
           this.errorModel.set(err);
diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js
index 98f774b..a0e071a 100644
--- a/web/pgadmin/browser/templates/browser/js/node.js
+++ b/web/pgadmin/browser/templates/browser/js/node.js
@@ -851,7 +851,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
                   if (d && !_.isEmpty(d)) {
                     m.save({}, {
                       attrs: d,
-                      validate: true,
+                      validate: false,
                       cache: false,
                       success: function() {
                         onSaveFunc.call();


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: pgadmin4 new server host rule is missing
  In-Reply-To: <CAJZJJmoMC0C_hBdP4ypv99-QKNOPrw=YS5L0iKsN5d8N0mAf-A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox