[form, migration] etype_relation_field should not raise error, it may block migration if used for a non yet existing field
--- a/web/views/autoform.py Wed Aug 11 18:11:32 2010 +0200
+++ b/web/views/autoform.py Thu Aug 12 10:11:49 2010 +0200
@@ -952,6 +952,10 @@
def etype_relation_field(etype, rtype, role='subject'):
eschema = vreg.schema.eschema(etype)
- return AutomaticEntityForm.field_by_name(rtype, role, eschema)
+ try:
+ return AutomaticEntityForm.field_by_name(rtype, role, eschema)
+ except f.FieldNotFound:
+ AutomaticEntityForm.error('field for %s %s may not be found in schema' % (rtype, role))
+ return None
vreg.register_all(globals().values(), __name__)