csv_import: report line of the first value seen on duplicate (#34270)

This commit is contained in:
Benjamin Dauvergne 2019-06-24 14:47:40 +02:00
parent 8cdd0cec16
commit fd2639ca18
1 changed files with 3 additions and 1 deletions

View File

@ -472,7 +472,9 @@ class UserCsvImporter(object):
errors.append(
Error('unique-constraint-failed',
_('Unique constraint on column "%(column)s" failed: '
'value already appear on line %(line)d') % {'column': header.name, 'line': row.line}))
'value already appear on line %(line)d') % {
'column': header.name,
'line': unique_map[unique_key]}))
else:
unique_map[unique_key] = row.line