Fixed SonarQube issues

This commit is contained in:
Akshay Joshi 2021-02-15 17:31:20 +05:30
parent 44cc7a308a
commit 3fc0cc3e92
10 changed files with 15 additions and 21 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>pgAdmin 4</title>
<style>

View File

@ -286,7 +286,7 @@ splashWindow.on('loaded', function() {
startDesktopMode();
})
.catch((errCode) => {
if (fixedPortCheck && errCode == 'EADDRINUSE') {
if (errCode == 'EADDRINUSE') {
alert('The specified fixed port is already in use. Please provide any other valid port.');
} else {
alert(errCode);

View File

@ -111,8 +111,7 @@ else:
# Flask default.
app.PGADMIN_RUNTIME = False
app.logger.debug(
'Server mode: %s, config server mode: %s',
SERVER_MODE, config.SERVER_MODE
'Config server mode: %s', config.SERVER_MODE
)
config.EFFECTIVE_SERVER_PORT = None
if 'PGADMIN_INT_PORT' in os.environ:

View File

@ -129,7 +129,7 @@ class AuthSourceManager():
self.current_source = source
@property
def get_current_source(self, source):
def get_current_source(self):
return self.current_source
def set_source(self, source):
@ -174,11 +174,9 @@ class AuthSourceManager():
# OR When kerberos authentication failed while accessing pgadmin,
# we need to break the loop as no need to authenticate further
# even if the authentication sources set to multiple
if not status:
if (hasattr(msg, 'status') and
if not status and (hasattr(msg, 'status') and
msg.status == '401 UNAUTHORIZED') or \
(source.get_source_name() ==
KERBEROS and
(source.get_source_name() == KERBEROS and
request.method == 'GET'):
break

View File

@ -290,8 +290,7 @@ class SchemaView(PGChildNodeView):
# Privileges
for aclcol in acls:
if specific is not None:
if aclcol not in specific:
if specific is not None and aclcol not in specific:
continue
if aclcol in data:
allowedacl = acls[aclcol]

View File

@ -77,9 +77,8 @@
.menu-groups-a{
display:flex !important;
flex-direction:column;
padding: 6px;
color: $dropdown-link-color;
padding: 6px 16px;
color: $dropdown-link-color;
}
.menu-groups-a span{

View File

@ -561,7 +561,6 @@ def sql(trans_id, sgid, sid, did):
@login_required
def tables(trans_id, sgid, sid, did):
helper = ERDHelper(trans_id, sid, did)
conn = _get_connection(sid, did, trans_id)
status, tables = helper.get_all_tables()
if not status:

View File

@ -11,7 +11,6 @@ import React, { useEffect, useState } from 'react';
import Tippy from '@tippyjs/react';
import gettext from 'sources/gettext';
import PropTypes from 'prop-types';
import { TableNodeModel } from '../nodes/TableNode';
import CustomPropTypes from 'sources/custom_prop_types';
/* The note component of ERD. It uses tippy to create the floating note */

View File

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////
/* This is used to change publicPath of webpack at runtime for loading chunks */
/* eslint-disable */
__webpack_public_path__ = window.resourceBasePath;
let __webpack_public_path__ = window.resourceBasePath;
/* eslint-enable */
import {launchDataGrid} from 'tools/datagrid/static/js/show_query_tool';

View File

@ -438,8 +438,9 @@ def change_owner():
data={}
)
except Exception as e:
msg = 'Unable to update shared server owner' + _(str(e))
return internal_server_error(
errormsg='Unable to update shared server owner')
errormsg=msg)
@blueprint.route(