cubicweb/entities/adapters.py
changeset 11416 9c2fbb872e91
parent 11358 179b5ff3f428
child 11761 78c8a2bb04ff
--- a/cubicweb/entities/adapters.py	Fri Jul 08 10:17:14 2016 +0200
+++ b/cubicweb/entities/adapters.py	Fri Jul 08 10:17:42 2016 +0200
@@ -21,7 +21,6 @@
 from cubicweb import _
 
 from itertools import chain
-from hashlib import md5
 
 from logilab.mtconverter import TransformError
 from logilab.common.decorators import cached
@@ -413,9 +412,7 @@
         for rschema, attrschema in eschema.attribute_definitions():
             rdef = rschema.rdef(eschema, attrschema)
             for constraint in rdef.constraints:
-                if cstrname == 'cstr' + md5(
-                        (eschema.type + rschema.type + constraint.type() +
-                         (constraint.serialize() or '')).encode('ascii')).hexdigest():
+                if cstrname == constraint.name_for(rdef):
                     break
             else:
                 continue