From d99e867c3ab1bdcde504213760f2d6d0acbcf823 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier Date: Fri, 27 Feb 2009 10:06:48 +0000 Subject: [PATCH] Distinguish the case where a related key has the same name as a column from the case where a related key is declared more than once. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25739 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ZSQLCatalog/SQLCatalog.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py index b351a9ebc3a..f4b05ad4ba8 100644 --- a/product/ZSQLCatalog/SQLCatalog.py +++ b/product/ZSQLCatalog/SQLCatalog.py @@ -1739,8 +1739,11 @@ class Catalog(Folder, LOG('SQLCatalog', 100, 'Malformed related key definition: %r. Ignored.' % (entire_definition, )) continue related_key_id = split_entire_definition[0].strip() - if related_key_id in column_set and related_key_id in column_map: - LOG('SQLCatalog', 100, 'Related key %r has the same name as an existing column on tables %r' % (related_key_id, column_map[related_key_id])) + if related_key_id in column_set: + if related_key_id in column_map: + LOG('SQLCatalog', 100, 'Related key %r has the same name as an existing column on tables %r' % (related_key_id, column_map[related_key_id])) + else: + LOG('SQLCatalog', 100, 'Related key %r is declared more than once.' % (related_key_id, ) column_set.add(related_key_id) return column_set -- 2.25.1