From f9266e884dc2b30d13a0f9529d8e092847cedc66 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 24 Jun 2019 14:47:40 +0200 Subject: [PATCH] csv_import: report line of the first value seen on duplicate (#34270) --- src/authentic2/csv_import.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/authentic2/csv_import.py b/src/authentic2/csv_import.py index 9a031d43..69b16f61 100644 --- a/src/authentic2/csv_import.py +++ b/src/authentic2/csv_import.py @@ -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 -- 2.20.1