web/views/editcontroller.py
changeset 5676 aa04ccb8dd62
parent 5575 8a531340c3ef
child 5877 0c7b7b76a84f
equal deleted inserted replaced
5675:4535f8e57580 5676:aa04ccb8dd62
   202                 role = None
   202                 role = None
   203             if form.field_by_name.im_func.func_code.co_argcount == 4: # XXX
   203             if form.field_by_name.im_func.func_code.co_argcount == 4: # XXX
   204                 field = form.field_by_name(name, role, eschema=entity.e_schema)
   204                 field = form.field_by_name(name, role, eschema=entity.e_schema)
   205             else:
   205             else:
   206                 field = form.field_by_name(name, role)
   206                 field = form.field_by_name(name, role)
   207             for field in field.actual_fields(form):
   207             if field.has_been_modified(form):
   208                 if field.has_been_modified(form):
   208                 self.handle_formfield(form, field, rqlquery)
   209                     self.handle_formfield(form, field, rqlquery)
       
   210         if self.errors:
   209         if self.errors:
   211             errors = dict((f.role_name(), unicode(ex)) for f, ex in self.errors)
   210             errors = dict((f.role_name(), unicode(ex)) for f, ex in self.errors)
   212             raise ValidationError(valerror_eid(entity.eid), errors)
   211             raise ValidationError(valerror_eid(entity.eid), errors)
   213         if eid is None: # creation or copy
   212         if eid is None: # creation or copy
   214             entity.eid = self._insert_entity(etype, formparams['eid'], rqlquery)
   213             entity.eid = self._insert_entity(etype, formparams['eid'], rqlquery)