Silent yams warning (first rdef selection from an ambiguous rtype)

authorFlorent Cayré <florent.cayre@logilab.fr>
changesetd0192478371c
branchdefault
phasedraft
hiddenno
parent revision#c5dcb7911dc7 fix: skip a wdoc test when doctuils is not available
child revision<not specified>
files modified by this revision
cubicweb/web/formfields.py
# HG changeset patch
# User Florent Cayré <florent.cayre@logilab.fr>
# Date 1451993284 -3600
# Tue Jan 05 12:28:04 2016 +0100
# Node ID d0192478371cf6b72602fbbeab8ab30a0452d1d8
# Parent c5dcb7911dc7f2a333594045306c0fd498d182dd
Silent yams warning (first rdef selection from an ambiguous rtype)

diff --git a/cubicweb/web/formfields.py b/cubicweb/web/formfields.py
@@ -1204,11 +1204,12 @@
1 
2      The field is initialized according to information found in the schema,
3      though any value can be explicitly specified using `kwargs`.
4      """
5      fieldclass = None
6 -    rdef = eschema.rdef(rschema, role)
7 +    # We do not know how to use more than the first rdef of the given rschema:
8 +    rdef = eschema.rdef(rschema, role, takefirst=True)
9      if role == 'subject':
10          targetschema = rdef.object
11          if rschema.final:
12              if rdef.get('internationalizable'):
13                  kwargs.setdefault('internationalizable', True)