server/repository.py
branchstable
changeset 9226 653f1d4a1101
parent 9184 b982e88e4836
child 9267 24d9b86dfa54
--- a/server/repository.py	Wed Aug 28 12:08:31 2013 +0200
+++ b/server/repository.py	Mon Sep 23 12:47:12 2013 +0200
@@ -1436,11 +1436,9 @@
                 source.update_entity(session, entity)
                 edited.saved = True
             except UniqueTogetherError as exc:
-                etype, rtypes = exc.args
-                problems = {}
-                for col in rtypes:
-                    problems[col] = session._('violates unique_together constraints (%s)') % (','.join(rtypes))
-                raise ValidationError(entity.eid, problems)
+                userhdlr = session.vreg['adapters'].select(
+                    'IUserFriendlyError', session, entity=entity, exc=exc)
+                userhdlr.raise_user_exception()
             self.system_source.update_info(session, entity, need_fti_update)
             if source.should_call_hooks:
                 if not only_inline_rels: