[FIX] postgres 9.2 added data at the end of 23502's error message, only use prefix matches not fullstring

bzr revid: xmo@openerp.com-20120927095038-m2vm663nqj1s1pne
This commit is contained in:
Xavier Morel 2012-09-27 11:50:38 +02:00
parent 9a721eba32
commit 9d175bdfd6
1 changed files with 1 additions and 1 deletions

View File

@ -5376,7 +5376,7 @@ class ImportWarning(Warning):
def convert_pgerror_23502(model, fields, info, e):
m = re.match(r'^null value in column "(?P<field>\w+)" violates '
r'not-null constraint\n$',
r'not-null constraint\n',
str(e))
if not m or m.group('field') not in fields:
return {'message': unicode(e)}