cleaner code stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 18 Sep 2009 19:51:27 +0200
branchstable
changeset 3331 8e63b72287b1
parent 3330 2fa09be849e7
child 3332 91cff87c368f
cleaner code
web/views/editforms.py
--- a/web/views/editforms.py	Fri Sep 18 19:51:13 2009 +0200
+++ b/web/views/editforms.py	Fri Sep 18 19:51:27 2009 +0200
@@ -521,10 +521,11 @@
         :param role: the role played by the `peid` in the relation
         """
         try:
-            entity = self.vreg['etypes'].etype_class(etype)(self.req, None, None)
+            cls = self.vreg['etypes'].etype_class(etype)
         except:
             self.w(self.req._('no such entity type %s') % etype)
             return
         self.initialize_varmaker()
+        entity = cls(self.req)
         entity.eid = self.varmaker.next()
         self.render_form(entity, peid, rtype, role, i18nctx)