mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-26 06:30:06 -05:00
Fixed some SonarQube issues.
This commit is contained in:
1 parent
faa66f1636
commit
008bc6da28
12 files changed
+46
-43
No files matched your search
+7
-7
@@ -19,6 +19,8 @@ import os
|
||||
import sys
|
||||
import builtins
|
||||
|
||||
USER_NOT_FOUND = "The specified user ID (%s) could not be found."
|
||||
|
||||
# Grab the SERVER_MODE if it's been set by the runtime
|
||||
if 'SERVER_MODE' in globals():
|
||||
builtins.SERVER_MODE = globals()['SERVER_MODE']
|
||||
@@ -77,8 +79,7 @@ def dump_servers(args):
|
||||
user = User.query.filter_by(email=dump_user).first()
|
||||
|
||||
if user is None:
|
||||
print("The specified user ID (%s) could not be found." %
|
||||
dump_user)
|
||||
print(USER_NOT_FOUND % dump_user)
|
||||
sys.exit(1)
|
||||
|
||||
user_id = user.id
|
||||
@@ -242,8 +243,7 @@ def load_servers(args):
|
||||
user = User.query.filter_by(email=load_user).first()
|
||||
|
||||
if user is None:
|
||||
print("The specified user ID (%s) could not be found." %
|
||||
load_user)
|
||||
print(USER_NOT_FOUND % load_user)
|
||||
sys.exit(1)
|
||||
|
||||
user_id = user.id
|
||||
@@ -416,8 +416,7 @@ def clear_servers():
|
||||
user = User.query.filter_by(email=load_user).first()
|
||||
|
||||
if user is None:
|
||||
print("The specified user ID (%s) could not be found." %
|
||||
load_user)
|
||||
print(USER_NOT_FOUND % load_user)
|
||||
sys.exit(1)
|
||||
|
||||
user_id = user.id
|
||||
@@ -439,7 +438,8 @@ def clear_servers():
|
||||
try:
|
||||
db.session.commit()
|
||||
except Exception as e:
|
||||
print("Error clearing server configuration")
|
||||
print("Error clearing server configuration with error (%s)" %
|
||||
str(e))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in new issue
Block a user