fix validation error
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 31 Aug 2009 17:10:28 +0200
changeset 57 81ade529d1b0
parent 56 9cae95b68efe
child 58 ff3b6ff260f3
fix validation error
hooks.py
--- a/hooks.py	Mon Aug 31 17:10:20 2009 +0200
+++ b/hooks.py	Mon Aug 31 17:10:28 2009 +0200
@@ -74,9 +74,8 @@
     def call(self, session, fromeid, rtype, toeid):
         # immediate test direct cycles
         if fromeid == toeid:
-            raise ValidationError(None,
-                                  session._('keyword %(kw)s cannot be subkeyword of himself') %
-                                  {'kw' : fromeid})
+            msg = session._('keyword cannot be subkeyword of himself')
+            raise ValidationError(fromeid, {'subkeyword_of' : msg})
         SetIncludedInRelationOp(session, vreg=self.vreg,
                                 fromeid=fromeid, toeid=toeid)