1) Flash warning message of N no of attempts left for the unsuccessful login attempt.

2) Updated some strings in the Preferences for the "Maximum column width" option.
This commit is contained in:
Akshay Joshi 2021-08-03 17:06:06 +05:30
parent 8e214ca8fb
commit 025c98ced8
4 changed files with 13 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -381,7 +381,7 @@ preferences for copied data.
auto-size to the maximum width of the data in the column as loaded in the auto-size to the maximum 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 first batch. If 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.
* Specify the maximum width of the column in pixel when 'Columns sized by' is * Specify the maximum width of the column in pixels when 'Columns sized by' is
set to *Column data*. If 'Columns sized by' is set to *Column name* then this set to *Column data*. If 'Columns sized by' is set to *Column name* then this
setting won't have any effect. setting won't have any effect.
* Use the *Result copy field separator* drop-down listbox to select the field * Use the *Result copy field separator* drop-down listbox to select the field

View File

@ -72,12 +72,22 @@ def login():
# Validate the user # Validate the user
if not auth_obj.validate(): if not auth_obj.validate():
for field in form.errors: for field in form.errors:
flash_login_attempt_error = None
if user: if user:
if config.MAX_LOGIN_ATTEMPTS > 0: if config.MAX_LOGIN_ATTEMPTS > 0:
user.login_attempts += 1 user.login_attempts += 1
left_attempts = \
config.MAX_LOGIN_ATTEMPTS - user.login_attempts
flash_login_attempt_error = \
gettext('You are left with {0} more attempts.'.
format(left_attempts))
db.session.commit() db.session.commit()
for error in form.errors[field]: for error in form.errors[field]:
flash(error, 'warning') flash(error, 'warning')
if flash_login_attempt_error:
flash(flash_login_attempt_error, 'warning')
return redirect(get_post_logout_redirect()) return redirect(get_post_logout_redirect())
# Authenticate the user # Authenticate the user

View File

@ -285,10 +285,10 @@ def register_query_tool_preferences(self):
self.column_data_max_width = self.preference.register( self.column_data_max_width = self.preference.register(
'Results_grid', 'column_data_max_width', 'Results_grid', 'column_data_max_width',
gettext("Maximum column width (in Pixel)"), 'integer', 0, gettext("Maximum column width"), 'integer', 0,
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 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\'.'
), ),
) )