mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-09-03 20:52:57 -05:00
Resolved few issues (with some improvements) with existing nodes.
This commit takes care of the following issues/improvements. * Adding missing imports for unauthorised in database module * Node under Servers Nodes (i.e. Databases, tablespaces, roles nodes) need to be inherited from PGChildNodeView (and, not from NodeView) for adding server version check for their children. * Adding statistics for database, and tablespaces in its node (not, yet in UI) * Renaming the camel case methods with proper name. (i.e. getSQL -> get_sql, getNewSQL -> get_new_sql, etc.) * Fixed the functions going beyond the text limit (column: 80) in Databases, Roles & Tablespaces modules. * Fixed the node method of Database module, which was not tested ever. * We do not need separate SQL template for fetching the name (i.e. get_name.sql), using the 'nodes.sql' for the same. * Optimise the query for fetching ACLs for the database node, we didn't require to join certain tables, while fetching only the ACLs. * Introduced the list of the ACLs (regular and default ACLs for different type) supported by each version [Databases Module]. * Renamed the templates 'get_nodes.sql' to' nodes.sql' to make it consistent with other modules. * Removed the checks for the authentication table use, as we don't need to expose the password to the users (even the encrypted MD5). Using the pg_roles view always for fetching roles/users information now. * Resolved some typos in unreachable (specially the exceptions catchment area.) * Logging the exception in the application. * Using qtLiteral, qtIdent properly in the templates (do not assume about the types of data.) * Using tsid as identifier instead of did for the tablespaces. * Using nodes method of tablespace view for fetching individual node information. * Removing the hardcoded node information from the 'parse_priv_to_db' function, and pass on allowed ACLs by the caller nodes. * Using 'nodes.sql' to fetch name of the template instead of writing that in the delete.sql template, which is definitely wrong place to fetch the name of the object. [Tablespace Module]
This commit is contained in:
@@ -19,7 +19,7 @@ from flask.ext.security import current_user
|
||||
|
||||
from ..abstract import BaseDriver, BaseConnection
|
||||
from pgadmin.settings.settings_model import Server, User
|
||||
from pgadmin.utils.crypto import encrypt, decrypt
|
||||
from pgadmin.utils.crypto import decrypt
|
||||
import random
|
||||
|
||||
from .keywords import ScanKeyword
|
||||
@@ -453,7 +453,7 @@ Attempt to reconnect it failed with the below error:
|
||||
pg_conn = psycopg2.connect(
|
||||
host=mgr.host,
|
||||
port=mgr.port,
|
||||
database=db,
|
||||
database=self.db,
|
||||
user=mgr.user,
|
||||
password=password
|
||||
)
|
||||
@@ -912,6 +912,7 @@ class Driver(BaseDriver):
|
||||
if type(val) == list:
|
||||
return map(lambda w: Driver.qtIdent(conn, w), val)
|
||||
|
||||
val = str(val)
|
||||
if len(val) == 0:
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user