[FIX] service: fix integrity error display
During the installation of a module, an IntegrityError can be raised, e.g. if some module data already exists in the database (as in the case of a module which uninstallation did not remove its data). In Python2 it was possible to use such a psycopg2.IntegrityError with i[0] to get its error message, while this raises an exception in Python3, i.args[0] is needed. As a result the log would contain an exception within an exception instead of displaying an error to the user. opw 1916374 closes odoo/odoo#29787
This commit is contained in:
@@ -138,7 +138,7 @@ def check(f):
|
||||
pass
|
||||
raise ValidationError(msg)
|
||||
else:
|
||||
raise ValidationError(inst[0])
|
||||
raise ValidationError(inst.args[0])
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
Reference in New Issue
Block a user