mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that the user should be able to drop the database even if it is connected. Fixes #5722
This commit is contained in:
committed by
Akshay Joshi
parent
b3d49c61a5
commit
86bbc3a9e8
@@ -872,6 +872,17 @@ class DatabaseView(PGChildNodeView):
|
||||
)
|
||||
)
|
||||
else:
|
||||
if self.conn.connected():
|
||||
# Release the connection if it is connected
|
||||
from pgadmin.utils.driver import get_driver
|
||||
manager = \
|
||||
get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
|
||||
manager.connection(did=did, auto_reconnect=True)
|
||||
status = manager.release(did=did)
|
||||
|
||||
if not status:
|
||||
return unauthorized(
|
||||
_("Database could not be deleted."))
|
||||
|
||||
SQL = render_template(
|
||||
"/".join([self.template_path, self._DELETE_SQL]),
|
||||
|
Reference in New Issue
Block a user