# HG changeset patch # User Rémi Cardona # Date 1442928298 -7200 # Node ID 874ac29b515d8fd02a668a43e65b1c79e5755521 # Parent 6ca54ea4ba4ddcdf89f16cd627bf0e0a6e49f7e0 [py3k] unicode → six.text_type diff -r 6ca54ea4ba4d -r 874ac29b515d web/views/editcontroller.py --- a/web/views/editcontroller.py Tue Sep 22 15:01:16 2015 +0200 +++ b/web/views/editcontroller.py Tue Sep 22 15:24:58 2015 +0200 @@ -24,6 +24,8 @@ from datetime import datetime +from six import text_type + from logilab.common.deprecation import deprecated from logilab.common.graph import ordered_nodes @@ -197,7 +199,7 @@ if '__linkto' in req.form and 'eid' in req.form: self.execute_linkto() elif not ('__delete' in req.form or '__insert' in req.form): - raise ValidationError(None, {None: unicode(ex)}) + raise ValidationError(None, {None: text_type(ex)}) # all pending inlined relations to newly created entities have been # treated now (pop to ensure there are no attempt to add new ones) pending_inlined = req.data.pop('pending_inlined') @@ -215,7 +217,7 @@ autoform.delete_relations(self._cw, todelete) self._cw.remove_pending_operations() if self.errors: - errors = dict((f.name, unicode(ex)) for f, ex in self.errors) + errors = dict((f.name, text_type(ex)) for f, ex in self.errors) raise ValidationError(valerror_eid(form.get('__maineid')), errors) def _insert_entity(self, etype, eid, rqlquery): @@ -265,7 +267,7 @@ for form_, field in req.data['pending_inlined'].pop(entity.eid, ()): rqlquery.set_inlined(field.name, form_.edited_entity.eid) if self.errors: - errors = dict((f.role_name(), unicode(ex)) for f, ex in self.errors) + errors = dict((f.role_name(), text_type(ex)) for f, ex in self.errors) raise ValidationError(valerror_eid(entity.eid), errors) if eid is None: # creation or copy entity.eid = eid = self._insert_entity(etype, formparams['eid'], rqlquery)