Fix innacurate error message on CSV check

We only know if a row contains missing cell(s), not how many cells are
missing data.

This commit changes the error message to be more accurate.
This commit is contained in:
Chris Hill-Scott
2016-04-18 11:27:23 +01:00
parent fb111b2968
commit a0e3a648f3
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:
number_of_rows_with_missing_data = len(list(recipients.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:
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

View File

@@ -49,7 +49,7 @@ MockRecipients = namedtuple(
[
'add a column called name',
'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',
'fix 4 phone numbers',
'fill in 4 empty cells'
'enter missing data in 4 rows'
]
)
]