Use str to test exception instead of unicode in integrity error

issue5446
review19161003
This commit is contained in:
Cédric Krier
2016-04-01 10:29:51 +02:00
parent 2e19c1b949
commit 46ff36af7b
+2 -2
View File
@@ -296,10 +296,10 @@ class ModelSQL(ModelStorage):
cls.raise_user_error('foreign_model_missing',
error_args=error_args)
for name, _, error in cls._sql_constraints:
if name in unicode(exception):
if name in str(exception):
cls.raise_user_error(error)
for name, error in cls._sql_error_messages.iteritems():
if name in unicode(exception):
if name in str(exception):
cls.raise_user_error(error)
@classmethod