diff -r b415bca9a9ed -r 94ed8f0f0d14 hooks/integrity.py --- a/hooks/integrity.py Wed Sep 02 10:24:15 2009 +0200 +++ b/hooks/integrity.py Wed Sep 02 10:53:51 2009 +0200 @@ -163,11 +163,11 @@ entity = self.entity eschema = entity.e_schema for attr in entity.edited_attributes: - val = entity[attr] - if val is None: - continue if eschema.subject_relation(attr).is_final() and \ eschema.has_unique_values(attr): + val = entity[attr] + if val is None: + continue rql = '%s X WHERE X %s %%(val)s' % (entity.e_schema, attr) rset = self._cw.unsafe_execute(rql, {'val': val}) if rset and rset[0][0] != entity.eid: