Python string cleanup

* Python string cleanup
* Fix line lengths
* Further Python string fixes.
pull/9377/head^2
Dave Page 2025-12-01 05:36:21 +00:00 committed by GitHub
parent ec3b508ba6
commit 70e4435b04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 84 additions and 87 deletions

View File

@ -172,7 +172,7 @@ def _mfa_registration_view(
if form_data[mfa.name] == 'SETUP': if form_data[mfa.name] == 'SETUP':
if supported_mfa['registered'] is True: if supported_mfa['registered'] is True:
flash(_("'{}' is already registered'").format(mfa.label), flash(_("'{}' is already registered.").format(mfa.label),
MessageType.SUCCESS) MessageType.SUCCESS)
return None return None

View File

@ -55,8 +55,8 @@ def register_browser_preferences(self):
gettext("Hide shared servers?"), 'boolean', False, gettext("Hide shared servers?"), 'boolean', False,
category_label=gettext('Display'), category_label=gettext('Display'),
help_str=gettext( help_str=gettext(
'If set to True, then all shared servers will be ' 'If set to True, all shared servers will be '
'hidden from browser tree' 'hidden from the browser tree.'
) )
) )
@ -75,8 +75,8 @@ def register_browser_preferences(self):
gettext("Confirm on close or refresh?"), 'boolean', gettext("Confirm on close or refresh?"), 'boolean',
True, category_label=PREF_LABEL_DISPLAY, True, category_label=PREF_LABEL_DISPLAY,
help_str=gettext( help_str=gettext(
'Confirm closure or refresh of the browser or browser tab is ' 'Confirm that closure or refresh of the browser or browser tab '
'intended before proceeding.' 'is intended before proceeding.'
) )
) )
@ -114,7 +114,7 @@ def register_browser_preferences(self):
min_val=1, max_val=9999, min_val=1, max_val=9999,
help_str=gettext( help_str=gettext(
'The maximum number of history rows to show on ' 'The maximum number of history rows to show on '
'the Statistics tab for pgAgent jobs' 'the Statistics tab for pgAgent jobs.'
) )
) )
@ -410,8 +410,8 @@ def register_browser_preferences(self):
gettext("Dynamic tab size"), 'boolean', False, gettext("Dynamic tab size"), 'boolean', False,
category_label=PREF_LABEL_TABS_SETTINGS, category_label=PREF_LABEL_TABS_SETTINGS,
help_str=gettext( help_str=gettext(
'If set to True, the tabs will take full size as per the title, ' 'If set to True, the tabs will take full size as per the title. '
'it will also applicable for already opened tabs') 'This will also apply to already opened tabs.')
) )
self.qt_tab_title = self.preference.register( self.qt_tab_title = self.preference.register(
@ -422,8 +422,7 @@ def register_browser_preferences(self):
help_str=gettext( help_str=gettext(
'Supported placeholders are %DATABASE%, %USERNAME%, and %SERVER%. ' 'Supported placeholders are %DATABASE%, %USERNAME%, and %SERVER%. '
'Users can provide any string with or without placeholders of' 'Users can provide any string with or without placeholders of'
' their choice. The blank title will be revert back to the' ' their choice. A blank title will revert to the default.'
' default title with placeholders.'
) )
) )
@ -435,8 +434,8 @@ def register_browser_preferences(self):
help_str=gettext( help_str=gettext(
'Supported placeholders are %SCHEMA%, %TABLE%, %DATABASE%, ' 'Supported placeholders are %SCHEMA%, %TABLE%, %DATABASE%, '
'%USERNAME%, and %SERVER%. Users can provide any string with or ' '%USERNAME%, and %SERVER%. Users can provide any string with or '
'without placeholders of their choice. The blank title will be ' 'without placeholders of their choice. A blank title will revert '
'revert back to the default title with placeholders.' 'to the default.'
) )
) )
@ -448,8 +447,8 @@ def register_browser_preferences(self):
help_str=gettext( help_str=gettext(
'Supported placeholders are %FUNCTION%, %ARGS%, %SCHEMA% and' 'Supported placeholders are %FUNCTION%, %ARGS%, %SCHEMA% and'
' %DATABASE%. Users can provide any string with or ' ' %DATABASE%. Users can provide any string with or '
'without placeholders of their choice. The blank title will be' 'without placeholders of their choice. A blank title will revert '
' revert back to the default title with placeholders.' 'to the default.'
) )
) )
@ -470,9 +469,9 @@ def register_browser_preferences(self):
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
options=open_new_tab_options, options=open_new_tab_options,
help_str=gettext( help_str=gettext(
'Select Query Tool, Debugger, Schema Diff, ERD Tool ' 'Select Query Tool, Debugger, Schema Diff, ERD Tool, '
'or PSQL Tool from the drop-down to set ' 'or PSQL Tool from the drop-down to open that module '
'open in new browser tab for that particular module.' 'in a new browser tab.'
), ),
control_props={ control_props={
'multiple': True, 'allowClear': False, 'multiple': True, 'allowClear': False,
@ -493,8 +492,8 @@ def register_browser_preferences(self):
help_str=gettext( help_str=gettext(
'Supported placeholders are %DATABASE%, %USERNAME%, ' 'Supported placeholders are %DATABASE%, %USERNAME%, '
'and %SERVER%. Users can provide any string with or without' 'and %SERVER%. Users can provide any string with or without'
' placeholders of their choice. The blank title will be revert' ' placeholders of their choice. A blank title will revert '
' back to the default title with placeholders.' 'to the default.'
) )
) )

View File

@ -330,8 +330,8 @@ def register_editor_preferences(self):
gettext("Expression Width"), 'integer', 50, gettext("Expression Width"), 'integer', 50,
category_label=PREF_LABEL_SQL_FORMATTING, category_label=PREF_LABEL_SQL_FORMATTING,
help_str=gettext( help_str=gettext(
'maximum number of characters in parenthesized expressions to be ' 'Maximum number of characters in parenthesized expressions to be '
'kept on single line.' 'kept on a single line.'
) )
) )
@ -355,7 +355,7 @@ def register_editor_preferences(self):
category_label=PREF_LABEL_SQL_FORMATTING, category_label=PREF_LABEL_SQL_FORMATTING,
help_str=gettext( help_str=gettext(
'Decides how many empty lines to leave between SQL statements. ' 'Decides how many empty lines to leave between SQL statements. '
'If zero it puts no new line.' 'A value of zero means no empty lines are added.'
) )
) )

View File

@ -945,8 +945,8 @@ class ServerNode(PGChildNodeView):
if arg in data: if arg in data:
return forbidden( return forbidden(
errmsg=gettext( errmsg=gettext(
"'{0}' is not allowed to modify, " "'{0}' cannot be modified "
"when server is connected." "when the server is connected."
).format(disp_lbl[arg]) ).format(disp_lbl[arg])
) )
@ -1968,7 +1968,7 @@ class ServerNode(PGChildNodeView):
info=msg, info=msg,
data={'in_recovery': True, 'wal_pause': pause} data={'in_recovery': True, 'wal_pause': pause}
) )
return gone(errormsg=gettext('Please connect the server.')) return gone(errormsg=gettext('Please connect to the server.'))
except Exception as e: except Exception as e:
current_app.logger.error( current_app.logger.error(
'WAL replay pause/resume failed' 'WAL replay pause/resume failed'
@ -2026,7 +2026,7 @@ class ServerNode(PGChildNodeView):
conn = manager.connection() conn = manager.connection()
if not conn.connected(): if not conn.connected():
return gone( return gone(
errormsg=gettext('Please connect the server.') errormsg=gettext('Please connect to the server.')
) )
if (not server.password or not manager.password) and \ if (not server.password or not manager.password) and \
@ -2042,7 +2042,7 @@ class ServerNode(PGChildNodeView):
) )
except Exception as e: except Exception as e:
current_app.logger.error( current_app.logger.error(
'Cannot able to fetch pgpass status' 'Unable to fetch pgpass status'
) )
return internal_server_error(errormsg=str(e)) return internal_server_error(errormsg=str(e))
@ -2147,7 +2147,7 @@ class ServerNode(PGChildNodeView):
return make_json_response( return make_json_response(
success=1, success=1,
info=gettext("The saved password cleared successfully."), info=gettext("The saved password was cleared successfully."),
data={'is_password_saved': False} data={'is_password_saved': False}
) )
@ -2179,7 +2179,7 @@ class ServerNode(PGChildNodeView):
return make_json_response( return make_json_response(
success=1, success=1,
info=gettext("The saved password cleared successfully."), info=gettext("The saved password was cleared successfully."),
data={'is_tunnel_password_saved': False} data={'is_tunnel_password_saved': False}
) )

View File

@ -713,12 +713,12 @@ class CastView(PGChildNodeView, SchemaDiffObjectCompare):
status, res = self.conn.execute_scalar(sql) status, res = self.conn.execute_scalar(sql)
if not status: if not status:
return internal_server_error(gettext( return internal_server_error(gettext(
"Could not generate reversed engineered SQL for the cast." "Could not generate reverse-engineered SQL for the cast."
) + "\n\n{0}".format(res)) ) + "\n\n{0}".format(res))
if res is None: if res is None:
return gone(gettext( return gone(gettext(
"Could not generate reversed engineered SQL for the " "Could not generate reverse-engineered SQL for the "
"cast node." "cast node."
)) ))

View File

@ -942,7 +942,7 @@ class FtsConfigurationView(PGChildNodeView, SchemaDiffObjectCompare):
if not status: if not status:
return internal_server_error( return internal_server_error(
_( _(
"Could not generate reversed engineered query for the " "Could not generate reverse-engineered query for the "
"FTS Configuration.\n{0}" "FTS Configuration.\n{0}"
).format(res) ).format(res)
) )
@ -950,7 +950,7 @@ class FtsConfigurationView(PGChildNodeView, SchemaDiffObjectCompare):
if res is None: if res is None:
return gone( return gone(
_( _(
"Could not generate reversed engineered query for " "Could not generate reverse-engineered query for "
"FTS Configuration node.") "FTS Configuration node.")
) )

View File

@ -883,7 +883,7 @@ class FtsParserView(PGChildNodeView, SchemaDiffObjectCompare):
if not status: if not status:
return internal_server_error( return internal_server_error(
_( _(
"Could not generate reversed engineered query for the " "Could not generate reverse-engineered query for the "
"FTS Parser.\n{0}" "FTS Parser.\n{0}"
).format(res) ).format(res)
) )
@ -891,7 +891,7 @@ class FtsParserView(PGChildNodeView, SchemaDiffObjectCompare):
if res is None: if res is None:
return gone( return gone(
_( _(
"Could not generate reversed engineered query for " "Could not generate reverse-engineered query for "
"FTS Parser node." "FTS Parser node."
) )
) )

View File

@ -755,14 +755,14 @@ class FtsTemplateView(PGChildNodeView, SchemaDiffObjectCompare):
if not status: if not status:
return internal_server_error( return internal_server_error(
gettext( gettext(
"Could not generate reversed engineered query for the " "Could not generate reverse-engineered query for the "
"FTS Template.\n{0}").format(res) "FTS Template.\n{0}").format(res)
) )
if res is None: if res is None:
return gone( return gone(
gettext( gettext(
"Could not generate reversed engineered query for " "Could not generate reverse-engineered query for "
"FTS Template node.") "FTS Template node.")
) )

View File

@ -904,7 +904,7 @@ rolmembership:{
if not status: if not status:
return internal_server_error( return internal_server_error(
_("Could not generate reversed engineered query for the " _("Could not generate reverse-engineered query for the "
"role.\n{0}").format( "role.\n{0}").format(
res res
) )
@ -912,7 +912,7 @@ rolmembership:{
if res is None or (len(res) == 0): if res is None or (len(res) == 0):
return gone( return gone(
_("Could not generate reversed engineered query for the role.") _("Could not generate reverse-engineered query for the role.")
) )
return ajax_response(response=res.strip('\n')) return ajax_response(response=res.strip('\n'))

View File

@ -99,10 +99,8 @@ class DashboardModule(PgAdminModule):
self.cpu_stats_refresh = self.dashboard_preference.register( self.cpu_stats_refresh = self.dashboard_preference.register(
'dashboards', 'cpu_stats_refresh', 'dashboards', 'cpu_stats_refresh',
gettext( gettext("CPU usage by process mode refresh rate"),
"Percentage of CPU time used by different process \ 'integer', 5, min_val=1, max_val=999999,
modes statistics refresh rate"
), 'integer', 5, min_val=1, max_val=999999,
category_label=PREF_LABEL_REFRESH_RATES, category_label=PREF_LABEL_REFRESH_RATES,
help_str=help_string help_str=help_string
) )
@ -198,16 +196,16 @@ class DashboardModule(PgAdminModule):
gettext("Use different data point styles?"), 'boolean', False, gettext("Use different data point styles?"), 'boolean', False,
category_label=PREF_LABEL_DISPLAY, category_label=PREF_LABEL_DISPLAY,
help_str=gettext('If set to True, data points will be visible ' help_str=gettext('If set to True, data points will be visible '
'in a different style on each graph lines.') 'in a different style on each graph line.')
) )
self.graph_mouse_track = self.graphs_preference.register( self.graph_mouse_track = self.graphs_preference.register(
'graphs', 'graph_mouse_track', 'graphs', 'graph_mouse_track',
gettext("Show mouse hover tooltip?"), 'boolean', True, gettext("Show mouse hover tooltip?"), 'boolean', True,
category_label=PREF_LABEL_DISPLAY, category_label=PREF_LABEL_DISPLAY,
help_str=gettext('If set to True, tooltip will appear on mouse ' help_str=gettext('If set to True, a tooltip will appear on mouse '
'hover on the graph lines giving the data point ' 'hover on the graph lines showing the data point '
'details') 'details.')
) )
self.graph_line_border_width = self.graphs_preference.register( self.graph_line_border_width = self.graphs_preference.register(

View File

@ -693,8 +693,8 @@ class BatchProcess:
except ValueError as e: except ValueError as e:
current_app.logger.warning( current_app.logger.warning(
_("Status for the background process '{0}' could " _("Could not load status for background process "
"not be loaded.").format(p.pid) "'{0}'.").format(p.pid)
) )
current_app.logger.exception(e) current_app.logger.exception(e)
return False, False return False, False
@ -902,7 +902,7 @@ class BatchProcess:
p.process_state = PROCESS_TERMINATED p.process_state = PROCESS_TERMINATED
except psutil.Error as e: except psutil.Error as e:
current_app.logger.warning( current_app.logger.warning(
_("Unable to kill the background process '{0}'").format( _("Unable to kill the background process '{0}'.").format(
p.utility_pid) p.utility_pid)
) )
current_app.logger.exception(e) current_app.logger.exception(e)

View File

@ -212,7 +212,7 @@ class DebuggerModule(PgAdminModule):
self.preference.register( self.preference.register(
'keyboard_shortcuts', 'keyboard_shortcuts',
'switch_panel', 'switch_panel',
gettext('Switch Panel'), gettext('Switch panel'),
'keyboardshortcut', 'keyboardshortcut',
{ {
'alt': True, 'alt': True,
@ -1658,7 +1658,7 @@ def deposit_parameter_value(trans_id):
if result['rows'][0]['pldbg_deposit_value']: if result['rows'][0]['pldbg_deposit_value']:
info = gettext('Value deposited successfully') info = gettext('Value deposited successfully')
else: else:
info = gettext('Error while setting the value') info = gettext('Error setting the value')
return make_json_response( return make_json_response(
data={ data={
'status': status, 'status': status,

View File

@ -297,7 +297,7 @@ def create_import_export_job(sid):
id=sid).first() id=sid).first()
if server is None: if server is None:
return bad_request(errormsg=_("Could not find the given server")) return bad_request(errormsg=_("Could not find the specified server."))
# To fetch MetaData for the server # To fetch MetaData for the server
from pgadmin.utils.driver import get_driver from pgadmin.utils.driver import get_driver
@ -333,13 +333,13 @@ def create_import_export_job(sid):
return bad_request(errormsg=str(e)) return bad_request(errormsg=str(e))
if not _file: if not _file:
return bad_request(errormsg=_('Please specify a valid file')) return bad_request(errormsg=_('Please specify a valid file.'))
elif IS_WIN: elif IS_WIN:
_file = _file.replace('\\', '/') _file = _file.replace('\\', '/')
data['filename'] = _file data['filename'] = _file
else: else:
return bad_request(errormsg=_('Please specify a valid file')) return bad_request(errormsg=_('Please specify a valid file.'))
# Get required and other columns list # Get required and other columns list
cols = _get_formatted_column_list(data, 'columns', driver, conn) cols = _get_formatted_column_list(data, 'columns', driver, conn)

View File

@ -178,7 +178,7 @@ def create_maintenance_job(sid, did):
if server is None: if server is None:
return make_json_response( return make_json_response(
success=0, success=0,
errormsg=_("Could not find the given server") errormsg=_("Could not find the specified server.")
) )
# To fetch MetaData for the server # To fetch MetaData for the server

View File

@ -431,8 +431,8 @@ def enter_key_press(data):
sio.emit('pty-output', sio.emit('pty-output',
{ {
'result': gettext( 'result': gettext(
'Connection terminated, To create new ' 'Connection terminated. To create a new '
'connection please open another psql' 'connection, please open another psql'
' tool.'), ' tool.'),
'error': True}, 'error': True},
namespace='/pty', room=request.sid) namespace='/pty', room=request.sid)

View File

@ -56,7 +56,7 @@ def register_query_tool_preferences(self):
self.explain_wal = self.preference.register( self.explain_wal = self.preference.register(
'Explain', 'explain_wal', 'Explain', 'explain_wal',
gettext("Show wal?"), 'boolean', False, gettext("Show WAL?"), 'boolean', False,
category_label=PREF_LABEL_EXPLAIN category_label=PREF_LABEL_EXPLAIN
) )
@ -104,8 +104,8 @@ def register_query_tool_preferences(self):
gettext("Prompt to save unsaved query changes?"), 'boolean', True, gettext("Prompt to save unsaved query changes?"), 'boolean', True,
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
help_str=gettext( help_str=gettext(
'Specifies whether or not to prompt user to save unsaved ' 'Specifies whether or not to prompt the user to save unsaved '
'query on query tool exit.' 'queries on Query Tool exit.'
) )
) )
@ -125,7 +125,7 @@ def register_query_tool_preferences(self):
gettext("Prompt to save unsaved data changes?"), 'boolean', True, gettext("Prompt to save unsaved data changes?"), 'boolean', True,
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
help_str=gettext( help_str=gettext(
'Specifies whether or not to prompt user to save unsaved ' 'Specifies whether or not to prompt the user to save unsaved '
'data on data grid exit.' 'data on data grid exit.'
) )
) )
@ -136,8 +136,8 @@ def register_query_tool_preferences(self):
True, True,
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
help_str=gettext( help_str=gettext(
'Specifies whether or not to prompt user to commit or rollback ' 'Specifies whether or not to prompt the user to commit or '
'an active transaction on Query Tool exit.' 'rollback an active transaction on Query Tool exit.'
) )
) )
@ -147,8 +147,8 @@ def register_query_tool_preferences(self):
False, False,
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
help_str=gettext( help_str=gettext(
'Specifies whether or not to copy SQL to query tool from ' 'Specifies whether or not to copy SQL to the Query Tool from '
'main window.' 'the main window.'
) )
) )
@ -168,8 +168,8 @@ def register_query_tool_preferences(self):
'boolean', True, 'boolean', True,
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
help_str=gettext( help_str=gettext(
'If set to True, View/Edit Data tool will show promote to ' 'If set to True, the View/Edit Data tool will show a confirmation '
'Query tool confirm dialog on query edit.' 'dialog to promote to Query Tool when the query is edited.'
) )
) )
@ -179,7 +179,7 @@ def register_query_tool_preferences(self):
'boolean', False, 'boolean', False,
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
help_str=gettext( help_str=gettext(
'If set to True, query tool will parse and underline ' 'If set to True, the Query Tool will parse and underline '
'the query at the cursor position.' 'the query at the cursor position.'
) )
) )
@ -190,9 +190,9 @@ def register_query_tool_preferences(self):
'boolean', True, 'boolean', True,
category_label=PREF_LABEL_OPTIONS, category_label=PREF_LABEL_OPTIONS,
help_str=gettext( help_str=gettext(
'If set to True, query tool will warn upon clicking the ' 'If set to True, the Query Tool will display a warning when '
'Execute Query button in the query tool. The warning will ' 'clicking the Execute Query button. The warning will appear '
'appear only if Underline query at cursor? is set to False.' 'only if "Underline query at cursor?" is set to False.'
) )
) )
@ -296,7 +296,7 @@ def register_query_tool_preferences(self):
{'label': gettext('Column name'), 'value': 'by_name'}], {'label': gettext('Column name'), 'value': 'by_name'}],
category_label=PREF_LABEL_RESULTS_GRID, category_label=PREF_LABEL_RESULTS_GRID,
help_str=gettext( help_str=gettext(
'If set to \'Column data\' columns will auto-size to the maximum ' 'If set to \'Column data\', columns will auto-size to the maximum '
'width of the data in the column as loaded in the first batch. If ' 'width of the data in the column as loaded in the first batch. If '
'set to \'Column name\', the column will be sized to the widest ' 'set to \'Column name\', the column will be sized to the widest '
'of the data type or column name.' 'of the data type or column name.'
@ -310,7 +310,7 @@ def register_query_tool_preferences(self):
category_label=PREF_LABEL_RESULTS_GRID, category_label=PREF_LABEL_RESULTS_GRID,
help_str=gettext( help_str=gettext(
'Specify the maximum width of the column in pixels when ' 'Specify the maximum width of the column in pixels when '
'\'Columns sized by \' is set to \'Column data\'.' '\'Columns sized by\' is set to \'Column data\'.'
), ),
) )
@ -319,17 +319,17 @@ def register_query_tool_preferences(self):
gettext("Data result rows per page"), 'integer', gettext("Data result rows per page"), 'integer',
DATA_RESULT_ROWS_PER_PAGE, min_val=10, DATA_RESULT_ROWS_PER_PAGE, min_val=10,
category_label=PREF_LABEL_RESULTS_GRID, category_label=PREF_LABEL_RESULTS_GRID,
help_str=gettext('Specify the number of records to fetch in one batch.' help_str=gettext('Specify the number of records to fetch in one '
' Changing this value will override' 'batch. Changing this value will override the '
' DATA_RESULT_ROWS_PER_PAGE setting from config ' 'DATA_RESULT_ROWS_PER_PAGE setting from the config '
' file.') 'file.')
) )
self.stripped_rows = self.preference.register( self.stripped_rows = self.preference.register(
'Results_grid', 'striped_rows', 'Results_grid', 'striped_rows',
gettext("Striped rows?"), 'boolean', gettext("Striped rows?"), 'boolean',
True, category_label=PREF_LABEL_RESULTS_GRID, True, category_label=PREF_LABEL_RESULTS_GRID,
help_str=gettext('If set to true, the result grid will display' help_str=gettext('If set to True, the result grid will display'
' rows with alternating background colors.') ' rows with alternating background colors.')
) )
@ -337,8 +337,8 @@ def register_query_tool_preferences(self):
'Results_grid', 'max_column_data_display_length', 'Results_grid', 'max_column_data_display_length',
gettext("Max column data display length"), 'integer', gettext("Max column data display length"), 'integer',
200, category_label=PREF_LABEL_RESULTS_GRID, 200, category_label=PREF_LABEL_RESULTS_GRID,
help_str=gettext('Maximum number of characters to be visible in the' help_str=gettext('Maximum number of characters to display in a '
' data output cell.') 'data cell.')
) )
self.display_connection_status = self.preference.register( self.display_connection_status = self.preference.register(
@ -744,8 +744,8 @@ def register_query_tool_preferences(self):
'auto_completion', 'keywords_in_uppercase', 'auto_completion', 'keywords_in_uppercase',
gettext("Keywords in uppercase"), 'boolean', True, gettext("Keywords in uppercase"), 'boolean', True,
category_label=gettext('Auto completion'), category_label=gettext('Auto completion'),
help_str=gettext('If set to True, Keywords will be displayed ' help_str=gettext('If set to True, keywords will be displayed '
'in upper case for auto completion.') 'in upper case for autocomplete.')
) )
self.preference.register( self.preference.register(

View File

@ -596,8 +596,8 @@ def validate_unique_user(data):
).count() ).count()
if exist_users != 0: if exist_users != 0:
raise InternalServerError(_("User email/username must be unique " raise InternalServerError(_("User email or username must be unique "
"for an authentication source.")) "for each authentication source."))
def validate_user(data): def validate_user(data):
@ -718,7 +718,7 @@ def update_user(uid, data):
for f in non_editable_params: for f in non_editable_params:
if f in data: if f in data:
return False, _("'{0}' is not allowed to modify.").format(f) return False, _("'{0}' cannot be modified.").format(f)
try: try:
new_data = validate_user(data) new_data = validate_user(data)

View File

@ -349,7 +349,7 @@ def does_utility_exist(file):
if Path(config.STORAGE_DIR) == Path(file) or \ if Path(config.STORAGE_DIR) == Path(file) or \
Path(config.STORAGE_DIR) in Path(file).parents: Path(config.STORAGE_DIR) in Path(file).parents:
error_msg = gettext("Please correct the Binary Path in the " error_msg = gettext("Please correct the Binary Path in the "
"Preferences. pgAdmin storage directory can not " "Preferences. pgAdmin storage directory cannot "
"be a utility binary directory.") "be a utility binary directory.")
if not os.path.exists(file): if not os.path.exists(file):