Fixed an issue where <br/> tag is visible in the error message when delete any database and it is in use.

This commit is contained in:
Akshay Joshi
2025-01-17 17:16:36 +05:30
parent 72a3ed9068
commit a410b15e30
4 changed files with 5 additions and 4 deletions

View File

@@ -34,7 +34,6 @@ from pgadmin.tools.sqleditor.utils.query_history import QueryHistory
from pgadmin.tools.schema_diff.node_registry import SchemaDiffRegistry
from pgadmin.model import db, Server, Database
from pgadmin.browser.utils import underscore_escape
from pgadmin.utils.constants import TWO_PARAM_STRING
@@ -1074,7 +1073,7 @@ class DatabaseView(PGChildNodeView):
status, errmsg = conn.connect()
return internal_server_error(
errormsg=underscore_escape(msg))
errormsg=msg)
return make_json_response(success=1)

View File

@@ -40,6 +40,7 @@ from pgadmin.utils.master_password import get_crypt_key
from io import StringIO
from pgadmin.utils.locker import ConnectionLocker
from pgadmin.utils.driver import get_driver
from pgadmin.browser.utils import underscore_escape
# On Windows, Psycopg is not compatible with the default ProactorEventLoop.
@@ -1688,7 +1689,7 @@ Failed to reset the connection to the server due to following error:
# if formatted_msg is false then return from the function
if not formatted_msg:
notices = self.get_notices()
errmsg = errmsg.replace('\n', '<br/>')
errmsg = underscore_escape(errmsg).replace('\n', '<br/>')
return errmsg if notices == '' else notices + '\n' + errmsg
# Do not append if error starts with `ERROR:` as most pg related