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

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


-- 
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.patch (824B, 2-servers_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);


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: <CAJZJJmpTMxG8W4S9TYp8fttbp4bwgTgmr9xGAC8LF0bBXkJn4Q@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