# HG changeset patch # User Sylvain Thénault # Date 1281600709 -7200 # Node ID 1aff7367a20c5aebee2eb707de649bf6a1663165 # Parent 3cd1e6a74830b567c378945a76c94ee06ce718e2 [form, migration] etype_relation_field should not raise error, it may block migration if used for a non yet existing field diff -r 3cd1e6a74830 -r 1aff7367a20c web/views/autoform.py --- 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__)