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:
parent
b3d49c61a5
commit
86bbc3a9e8
@ -19,5 +19,6 @@ Housekeeping
|
||||
Bug fixes
|
||||
*********
|
||||
|
||||
| `Issue #5722 <https://redmine.postgresql.org/issues/5722>`_ - Ensure that the user should be able to drop the database even if it is connected.
|
||||
| `Issue #5748 <https://redmine.postgresql.org/issues/5748>`_ - Fixed incorrect reverse engineering SQL for Foreign key when creating a table.
|
||||
| `Issue #5754 <https://redmine.postgresql.org/issues/5754>`_ - Fixed an issue where schema diff is not working when providing the options to Foreign Data Wrapper, Foreign Server, and User Mapping.
|
||||
|
@ -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]),
|
||||
|
Loading…
Reference in New Issue
Block a user