mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-10 03:14:58 -04:00
Explain 3 required address columns
Our rules about address columns are relaxing, so that none of them are mandatory any more. Instead you just need any 3 of the 7 to make a valid address. This commit updates our error messaging to reflect that.
This commit is contained in:
11
app/utils.py
11
app/utils.py
@@ -151,6 +151,15 @@ def get_errors_for_csv(recipients, template_type):
|
||||
return errors
|
||||
|
||||
|
||||
def get_sample_template(template_type):
|
||||
if template_type == 'email':
|
||||
return EmailPreviewTemplate({'content': 'any', 'subject': '', 'template_type': 'email'})
|
||||
if template_type == 'sms':
|
||||
return SMSPreviewTemplate({'content': 'any', 'template_type': 'sms'})
|
||||
if template_type == 'letter':
|
||||
return LetterImageTemplate({'content': 'any', 'subject': '', 'template_type': 'letter'})
|
||||
|
||||
|
||||
def generate_notifications_csv(**kwargs):
|
||||
from app import notification_api_client
|
||||
from app.s3_client.s3_csv_client import s3download
|
||||
@@ -161,7 +170,7 @@ def generate_notifications_csv(**kwargs):
|
||||
original_file_contents = s3download(kwargs['service_id'], kwargs['job_id'])
|
||||
original_upload = RecipientCSV(
|
||||
original_file_contents,
|
||||
template_type=kwargs['template_type'],
|
||||
template=get_sample_template(kwargs['template_type']),
|
||||
)
|
||||
original_column_headers = original_upload.column_headers
|
||||
fieldnames = ['Row number'] + original_column_headers + ['Template', 'Type', 'Job', 'Status', 'Time']
|
||||
|
||||
Reference in New Issue
Block a user