# HG changeset patch # User Sylvain Thénault # Date 1244190236 -7200 # Node ID ce184fdb1e56d7bc09d9ffaf3892c5b2a22bff9a # Parent b9baedffeb8b1d16118b00bf5c1fe5efa634b9db fix submit message handling in entity form diff -r b9baedffeb8b -r ce184fdb1e56 web/views/forms.py --- a/web/views/forms.py Fri Jun 05 10:18:40 2009 +0200 +++ b/web/views/forms.py Fri Jun 05 10:23:56 2009 +0200 @@ -267,14 +267,18 @@ self.edited_entity = self.complete_entity(self.row or 0, self.col or 0) self.form_add_hidden('__type', eidparam=True) self.form_add_hidden('eid') - if msg: - self.form_add_hidden('__message', msg) if kwargs.get('mainform'): self.form_add_hidden(u'__maineid', self.edited_entity.eid) # If we need to directly attach the new object to another one - for linkto in self.req.list_form_param('__linkto'): - self.form_add_hidden('__linkto', linkto) - msg = '%s %s' % (msg, self.req._('and linked')) + if self.req.list_form_param('__linkto'): + for linkto in self.req.list_form_param('__linkto'): + self.form_add_hidden('__linkto', linkto) + if msg: + msg = '%s %s' % (msg, self.req._('and linked')) + else: + msg = self.req._('entity linked') + if msg: + self.form_add_hidden('__message', msg) def _field_has_error(self, field): """return true if the field has some error in given validation exception