# HG changeset patch # User Sylvain Thénault # Date 1345637842 -7200 # Node ID 199fefe396ab18318b8719aa35b86636cf6bc091 # Parent 75fe6dca79b4835720233a28e5b9143f9e2909f3 [form] add assertion to ensure field has a name when `role_name` is called diff -r 75fe6dca79b4 -r 199fefe396ab web/formfields.py --- a/web/formfields.py Tue Aug 21 15:23:29 2012 +0200 +++ b/web/formfields.py Wed Aug 22 14:17:22 2012 +0200 @@ -313,6 +313,7 @@ def role_name(self): """return - if role is specified, else field.name""" + assert self.name, 'field without a name (give it to constructor for explicitly built fields)' if self.role is not None: return role_name(self.name, self.role) return self.name