1) Fix issue where validate switch for the foreign key is enabled from table dialog even if the key is validated.

2) Fix issue where validate the foreign key from the table dialog, rename the foreign key constraint to none.
pull/26/head
Akshay Joshi 2019-10-14 18:19:32 +05:30
parent 7c271d21ae
commit 2790689d26
2 changed files with 4 additions and 1 deletions

View File

@ -793,7 +793,7 @@ define('pgadmin.node.foreign_key', [
if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
// If OID is undefined then user is trying to add
// new constraint which should allowed
return !(_.isUndefined(m.get('oid')) || m.get('convalidated'));
return !(_.isUndefined(m.get('oid')) || !m.get('convalidated'));
}
// We can't update condeferred of existing foreign key.
return !(m.isNew() || !m.get('convalidated'));

View File

@ -1495,6 +1495,9 @@ class BaseTableView(PGChildNodeView, BasePartitionTable):
return internal_server_error(errormsg=res)
old_data = res['rows'][0]
if 'name' not in c:
c['name'] = old_data['name']
# Sql to update object
sql.append(
render_template("/".join([