public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pradip Parkale <[email protected]>
To: Akshay Joshi <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Cc: Cyril Jouve <[email protected]>
Subject: Re: RM5841: server.username can be empty when using .pg_service.conf
Date: Mon, 21 Sep 2020 16:41:27 +0530
Message-ID: <CAJ9T6SsYhopg_gboy+0Mt=6rGAhN141yDoam3qGpt470yRnNrQ@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDfvOYp=iyQ8Yqob6X7ywLKVe1xD=0u0YmaJ7X1p2WsA5A@mail.gmail.com>
References: <CANhjAHxpK_j_w1Zmu5Keofsqz4bbcpsnKR8ybNPZUqQNN-DANg@mail.gmail.com>
	<CANxoLDfvOYp=iyQ8Yqob6X7ywLKVe1xD=0u0YmaJ7X1p2WsA5A@mail.gmail.com>

Hi Akshay,


On Mon, Sep 21, 2020 at 9:30 AM Akshay Joshi <[email protected]>
wrote:

> Hi Pradip
>
> Can you please review the patch as that condition we have added for Shared
> Server implementation?
>
Yes, we have added this for the shared server implementation. Please find
the attached for this issue.

>
> On Sat, Sep 19, 2020 at 6:22 PM Cyril Jouve <[email protected]> wrote:
>
>> fix for https://redmine.postgresql.org/issues/5841
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Sr. Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


Attachments:

  [application/x-patch] RM5841.patch (2.1K, 3-RM5841.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py
index ed8fae0f0..10efa4e87 100644
--- a/web/pgadmin/browser/server_groups/servers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/__init__.py
@@ -194,14 +194,6 @@ class ServerModule(sg.ServerGroupPluginModule):
                     # set to true
                     continue
 
-                # if hide_shared_server or \
-                #         shared_server.name == auto_detected_server:
-                #     # Don't include shared server if hide shared server is
-                #     # set to true
-                #     continue
-
-                # if shared_server.name == auto_detected_server:
-                #     continue
                 server = self.get_shared_server_properties(server,
                                                            shared_server)
             connected = False
@@ -1281,7 +1273,7 @@ class ServerNode(PGChildNodeView):
             return bad_request(self.not_found_error_msg())
 
         # Return if username is blank
-        if server.username is None:
+        if server.username is None and not server.service:
             return make_json_response(
                 status=200,
                 success=0,
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 37942da08..8a4be22b4 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -1208,7 +1208,7 @@ define('pgadmin.node.server', [
       $.get(server_url)
         .done(function(res) {
           if (res.shared && _.isNull(res.username) && data.user_id != current_user.id){
-            if (selectedTreeNodeData._type == 'server'){
+            if (selectedTreeNodeData._type == 'server' && !res.service){
               pgAdmin.Browser.Node.callbacks.show_obj_properties.call(
                 pgAdmin.Browser.Nodes[tree.itemData(item)._type], {action: 'edit'}
               );


view thread (5+ 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], [email protected], [email protected]
  Subject: Re: RM5841: server.username can be empty when using .pg_service.conf
  In-Reply-To: <CAJ9T6SsYhopg_gboy+0Mt=6rGAhN141yDoam3qGpt470yRnNrQ@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