## Generates a single diff for a single row, ignoring the Status field
<%def name="singlediff(row)">@@ ${row['key']}
%for k in row['changes']:
%if k != 'Status':
-${k}:${row['changes'][k][0]}
+${k}:${row['changes'][k][1]}
%endif
%endfor
%def>
## Get description from a changed row
## Either from the changed or unchanged portion
<%def name="description(row)">
% if 'Description' in row['unchanged']:
${row['unchanged']['Description']}
%else:
${row['changes']['Description'][1]}
%endif
%def>
% if len(added) > 0:
Additions
The following new ISINs were added:
ISIN|Description|Issuer|Type|Status
----|-----------|------|---------------|------
% for row in added:
`${row['ISIN']}`|${row['Description']}|${row['Issuer']}|${row['Type']}|${row['Status'].title()}
% endfor
%endif
% if len(changed) > 0:
Changes
The following ISINs changed their status:
ISIN |
Description |
Old Status |
New Status |
% for row in changed:
% if 'Status' in row['changes']:
${row['key']} |
${description(row)} |
${row['changes']['Status'][0].title()} |
${row['changes']['Status'][1].title()} |
% endif
% endfor
The following ISINs changed other fields:
```diff
% for row in changed:
% if 'Status' not in row['changes']:
${singlediff(row)}
% endif
% endfor
```
%endif
## Removals may happen accidentally because NSDL website returns a 5xx
%if len(removed) > 0:
Removals
The following ISINs were completely removed (likely in error):
ISIN|Description|Issuer|Type|Status
----|-----------|------|---------------|------
% for row in removed:
`${row['ISIN']}`|${row['Description']}|${row['Issuer']}|${row['Type']}|${row['Status'].title()}
% endfor
%endif