[REM] User-friendly constraint error

For Python constraints defined with the v7 API, the ORM used to display a
complex error message. We remove these technical terms for the end-user.
This commit is contained in:
Prashant Panchal
2014-12-31 10:40:28 +01:00
committed by Richard Mathot
parent a60f1ed8c4
commit 86c4debff0
+1 -4
View File
@@ -1268,10 +1268,7 @@ class BaseModel(object):
res_msg = trans._get_source(self._name, 'constraint', self.env.lang, msg)
if extra_error:
res_msg += "\n\n%s\n%s" % (_('Error details:'), extra_error)
errors.append(
_("Field(s) `%s` failed against a constraint: %s") %
(', '.join(names), res_msg)
)
errors.append(_(res_msg))
if errors:
raise ValidationError('\n'.join(errors))