Merge pull request #464 from alphagov/correct-innacurate-csv-error

Fix innacurate error message on CSV check
This commit is contained in:
Chris Hill-Scott
2016-04-18 16:52:52 +01:00
2 changed files with 4 additions and 4 deletions

View File

@@ -79,9 +79,9 @@ def get_errors_for_csv(recipients, template_type):
if recipients.rows_with_missing_data: if recipients.rows_with_missing_data:
number_of_rows_with_missing_data = len(list(recipients.rows_with_missing_data)) number_of_rows_with_missing_data = len(list(recipients.rows_with_missing_data))
if 1 == number_of_rows_with_missing_data: if 1 == number_of_rows_with_missing_data:
errors.append("fill in 1 empty cell") errors.append("enter missing data in 1 row")
else: else:
errors.append("fill in {} empty cells".format(number_of_rows_with_missing_data)) errors.append("enter missing data in {} rows".format(number_of_rows_with_missing_data))
return errors return errors

View File

@@ -49,7 +49,7 @@ MockRecipients = namedtuple(
[ [
'add a column called name', 'add a column called name',
'fix 1 phone number', 'fix 1 phone number',
'fill in 1 empty cell' 'enter missing data in 1 row'
] ]
), ),
( (
@@ -63,7 +63,7 @@ MockRecipients = namedtuple(
[ [
'add columns called name, date, and time', 'add columns called name, date, and time',
'fix 4 phone numbers', 'fix 4 phone numbers',
'fill in 4 empty cells' 'enter missing data in 4 rows'
] ]
) )
] ]