cubicweb/web/views/forms.py
changeset 11910 af969080e7e6
parent 11870 3a84a79c4ed5
child 12567 26744ad37953
--- a/cubicweb/web/views/forms.py	Thu Jan 19 14:53:05 2017 +0100
+++ b/cubicweb/web/views/forms.py	Fri Jan 20 10:31:04 2017 +0100
@@ -318,16 +318,16 @@
             rschema = eschema.schema.rschema(name)
             # XXX use a sample target type. Document this.
             tschemas = rschema.targets(eschema, role)
-            fieldcls = cls_or_self.uicfg_aff.etype_get(
+            fieldclass = cls_or_self.uicfg_aff.etype_get(
                 eschema, rschema, role, tschemas[0])
             kwargs = cls_or_self.uicfg_affk.etype_get(
                 eschema, rschema, role, tschemas[0])
             if kwargs is None:
                 kwargs = {}
-            if fieldcls:
-                if not isinstance(fieldcls, type):
-                    return fieldcls  # already and instance
-                return fieldcls(name=name, role=role, eidparam=True, **kwargs)
+            if fieldclass:
+                if not isinstance(fieldclass, type):
+                    return fieldclass  # already an instance
+                kwargs['fieldclass'] = fieldclass
             if isinstance(cls_or_self, type):
                 req = None
             else: