--- a/web/views/autoform.py Wed Oct 06 11:57:21 2010 +0200
+++ b/web/views/autoform.py Wed Oct 06 14:04:26 2010 +0200
@@ -941,10 +941,11 @@
global etype_relation_field
def etype_relation_field(etype, rtype, role='subject'):
- eschema = vreg.schema.eschema(etype)
try:
+ eschema = vreg.schema.eschema(etype)
return AutomaticEntityForm.field_by_name(rtype, role, eschema)
- except f.FieldNotFound:
+ except (KeyError, f.FieldNotFound):
+ # catch KeyError raised when etype/rtype not found in schema
AutomaticEntityForm.error('field for %s %s may not be found in schema' % (rtype, role))
return None