Ensure first argument of DatabaseIntegrityError is a string
issue4836 review8191003
This commit is contained in:
1 parent
e4546c3459
commit
1f18f65c33
1 file changed
+2
-2
@@ -283,10 +283,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 exception[0]:
|
||||
if name in str(exception[0]):
|
||||
cls.raise_user_error(error)
|
||||
for name, error in cls._sql_error_messages.iteritems():
|
||||
if name in exception[0]:
|
||||
if name in str(exception[0]):
|
||||
cls.raise_user_error(error)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in new issue
Block a user