diff --git a/docs/en_US/release_notes_5_7.rst b/docs/en_US/release_notes_5_7.rst index 158bf9196..df1e59772 100644 --- a/docs/en_US/release_notes_5_7.rst +++ b/docs/en_US/release_notes_5_7.rst @@ -18,4 +18,5 @@ Housekeeping Bug fixes ********* +| `Issue #6564 `_ - Fixed an issue where columns with sequences get altered unnecessarily with a schema diff tool. | `Issue #6572 `_ - Partially fixes the data output panel display issue. diff --git a/web/pgadmin/authenticate/__init__.py b/web/pgadmin/authenticate/__init__.py index b6a9d7564..82c5ea9b0 100644 --- a/web/pgadmin/authenticate/__init__.py +++ b/web/pgadmin/authenticate/__init__.py @@ -79,16 +79,21 @@ def login(): 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)) + if left_attempts > 1: + flash_login_attempt_error = \ + gettext('{0} more attempts remaining.'. + format(left_attempts)) + else: + flash_login_attempt_error = \ + gettext('{0} more attempt remaining.'. + format(left_attempts)) db.session.commit() for error in form.errors[field]: + if flash_login_attempt_error: + error = error + flash_login_attempt_error + flash_login_attempt_error = None flash(error, 'warning') - if flash_login_attempt_error: - flash(flash_login_attempt_error, 'warning') - return redirect(get_post_logout_redirect()) # Authenticate the user diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py index 851eb4ea2..e34dd8992 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py @@ -19,11 +19,13 @@ from pgadmin.tools.schema_diff.node_registry import SchemaDiffRegistry class SchemaDiffTableCompare(SchemaDiffObjectCompare): - table_keys_to_ignore = ['oid', 'schema', 'edit_types', 'attnum', + table_keys_to_ignore = ['oid', 'schema', 'edit_types', 'col_type', 'references', 'reltuples', 'oid-2', - 'rows_cnt', 'seqrelid', 'atttypid', 'elemoid', - 'hastoasttable', 'relhassubclass', 'relacl_str', - 'setting'] + 'rows_cnt', 'hastoasttable', 'relhassubclass', + 'relacl_str', 'setting'] + + column_keys_to_ignore = ['attnum', 'atttypid', 'edit_types', 'elemoid', + 'seqrelid'] constraint_keys_to_ignore = ['relname', 'nspname', 'parent_tbl', 'attrelid', 'adrelid', 'fknsp', 'confrelid', @@ -34,8 +36,9 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare): 'tgqual', 'tgconstraint'] index_keys_to_ignore = ['indrelid', 'indclass'] - keys_to_ignore = table_keys_to_ignore + constraint_keys_to_ignore \ - + trigger_keys_to_ignore + index_keys_to_ignore + keys_to_ignore = table_keys_to_ignore + column_keys_to_ignore + \ + constraint_keys_to_ignore + trigger_keys_to_ignore + \ + index_keys_to_ignore def compare(self, **kwargs): """ @@ -156,8 +159,16 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare): """ tmp = None for item in target_cols: + # ignore keys from the columns list + for ig_key in SchemaDiffTableCompare.column_keys_to_ignore: + if ig_key in source: + del source[ig_key] + if ig_key in item: + del item[ig_key] + if item['name'] == source['name']: tmp = copy.deepcopy(item) + if tmp and source != tmp: tmp_updated = copy.deepcopy(source) # Preserve the column number