Don't offer an option to drop the current maintenance database. Fixes #1382

This commit is contained in:
Murtuza Zabuawala
2016-06-23 11:37:32 +01:00
committed by Dave Page
parent b78b3904cd
commit e5ee592470
2 changed files with 7 additions and 4 deletions

View File

@@ -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
)
)

View File

@@ -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';