mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Don't offer an option to drop the current maintenance database. Fixes #1382
This commit is contained in:
committed by
Dave Page
parent
b78b3904cd
commit
e5ee592470
@@ -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
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user