mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #1077 from alphagov/fix-row-number-issue-on-report-download
Fix issue where row_number starts from 3 on a job report download
This commit is contained in:
@@ -164,8 +164,12 @@ def generate_notifications_csv(**kwargs):
|
||||
|
||||
def format_notification_for_csv(notification):
|
||||
from app import format_datetime_24h, format_notification_status
|
||||
# row_number can be 0 so we need to check for it
|
||||
row_num = notification.get('job_row_number')
|
||||
row_num = '' if row_num is None else row_num + 1
|
||||
|
||||
return {
|
||||
'Row number': int(notification['job_row_number']) + 2 if notification.get('job_row_number') else '',
|
||||
'Row number': row_num,
|
||||
'Recipient': notification['to'],
|
||||
'Template': notification['template']['name'],
|
||||
'Type': notification['template']['template_type'],
|
||||
|
||||
Reference in New Issue
Block a user