Hi

PFA patch to fix the issue mentioned in RM#1382.
To fix the issue we will not display drop option on maintenance db.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/server_groups/servers/databases/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
index 0086379..1f7fd07 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
@@ -188,11 +188,11 @@ class DatabaseView(PGChildNodeView):
         for row in rset['rows']:
             if self.manager.db == row['name']:
                 connected = True
-                canDisConn = False
+                canDrop = canDisConn = False
             else:
                 conn = self.manager.connection(row['name'])
                 connected = conn.connected()
-                canDisConn = True
+                canDrop = canDisConn = True
 
             res.append(
                 self.blueprint.generate_browser_node(
@@ -205,7 +205,8 @@ class DatabaseView(PGChildNodeView):
                     tablespace=row['spcname'],
                     allowConn=row['datallowconn'],
                     canCreate=row['cancreate'],
-                    canDisconn=canDisConn
+                    canDisconn=canDisConn,
+                    canDrop = canDrop
                 )
             )
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js
index 51a77db..61671f4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js
@@ -26,7 +26,9 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
       hasSQL: true,
       hasDepends: true,
       hasStatistics: true,
-      canDrop: true,
+      canDrop: function(node) {
+        return node.canDrop;
+      },
       label: '{{ _('Database') }}',
       node_image: function() {
         return 'pg-icon-database';
-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to