[schema] ensure we don't remove has_text relation type unfortunatly stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 31 Mar 2010 15:59:32 +0200
branchstable
changeset 5122 c06078d59e87
parent 5118 768beb8e15f1
child 5123 d4b18bb90550
[schema] ensure we don't remove has_text relation type unfortunatly
schema.py
--- a/schema.py	Wed Mar 31 15:04:36 2010 +0200
+++ b/schema.py	Wed Mar 31 15:59:32 2010 +0200
@@ -400,7 +400,9 @@
                                           __permissions__=RO_ATTR_PERMS)
             self.schema.add_relation_def(rdef)
         elif not need_has_text and has_has_text:
-            self.schema.del_relation_def(self.type, 'has_text', 'String')
+            # use rschema.del_relation_def and not schema.del_relation_def to
+            # avoid deleting the relation type accidentally...
+            self.schema['has_text'].del_relation_def(self, self.schema['String'])
 
     def schema_entity(self):
         """return True if this entity type is used to build the schema"""