hooks/integrity.py
changeset 6376 f8662240ed4d
parent 6142 8bc6eac1fac1
parent 6375 df4fd2a1b0e7
child 6426 541659c39f6a
--- a/hooks/integrity.py	Fri Oct 01 09:26:17 2010 +0200
+++ b/hooks/integrity.py	Fri Oct 01 11:24:21 2010 +0200
@@ -26,7 +26,8 @@
 from yams.schema import role_name
 
 from cubicweb import ValidationError
-from cubicweb.schema import RQLConstraint, RQLUniqueConstraint
+from cubicweb.schema import (META_RTYPES, WORKFLOW_RTYPES,
+                             RQLConstraint, RQLUniqueConstraint)
 from cubicweb.selectors import is_instance
 from cubicweb.uilib import soup2xhtml
 from cubicweb.server import hook
@@ -34,11 +35,8 @@
 
 # special relations that don't have to be checked for integrity, usually
 # because they are handled internally by hooks (so we trust ourselves)
-DONT_CHECK_RTYPES_ON_ADD = set(('owned_by', 'created_by',
-                                'is', 'is_instance_of',
-                                'wf_info_for', 'from_state', 'to_state'))
-DONT_CHECK_RTYPES_ON_DEL = set(('is', 'is_instance_of',
-                                'wf_info_for', 'from_state', 'to_state'))
+DONT_CHECK_RTYPES_ON_ADD = META_RTYPES | WORKFLOW_RTYPES
+DONT_CHECK_RTYPES_ON_DEL = META_RTYPES | WORKFLOW_RTYPES
 
 _UNIQUE_CONSTRAINTS_LOCK = Lock()
 _UNIQUE_CONSTRAINTS_HOLDER = None