server/sources/native.py
branchstable
changeset 7530 15178bf89fb6
parent 7507 4c043afb104a
child 7536 29961a416faa
child 7551 2d4ba5b984dc
--- a/server/sources/native.py	Thu Jun 16 12:31:27 2011 +0200
+++ b/server/sources/native.py	Thu Jun 09 16:41:41 2011 +0200
@@ -165,6 +165,15 @@
 class UndoException(Exception):
     """something went wrong during undoing"""
 
+    def __unicode__(self):
+        """Called by the unicode builtin; should return a Unicode object
+
+        Type of UndoException message must be `unicode` by design in CubicWeb.
+
+        .. warning::
+            This method is not available in python2.5"""
+        assert isinstance(self.message, unicode)
+        return self.message
 
 def _undo_check_relation_target(tentity, rdef, role):
     """check linked entity has not been redirected for this relation"""