aboutsummaryrefslogtreecommitdiffstats
path: root/python/load_intex_collateral.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/load_intex_collateral.py')
-rw-r--r--python/load_intex_collateral.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/python/load_intex_collateral.py b/python/load_intex_collateral.py
index c0a283f4..f7437d15 100644
--- a/python/load_intex_collateral.py
+++ b/python/load_intex_collateral.py
@@ -45,6 +45,9 @@ def upload_data(dealnames, workdate, conn, cursor):
print("LoanX ID column is missing. Probably an error in exporting from intex")
pdb.set_trace()
data = []
+ if 'Reinvest Collat' in missingfields:
+ print('no reinvestment asset')
+ pdb.set_trace()
for line in dr:
for f in missingfields:
line[f] = None
@@ -57,15 +60,13 @@ def upload_data(dealnames, workdate, conn, cursor):
if len(line['LoanX ID']) > 8:
print("dubious id found: {0}".format(line['LoanX ID']))
line['LoanX ID'] = line['LoanX ID'][:8]
- try:
- # make sure the string is utf8 safe
- line['Issuer'] = line['Issuer'].decode('windows-1252')
- if line['Reinvest Collat'].upper() == 'Y' or line['Issuer'] == '':
- # assume it's a reinvestment asset
- line['Reinvest Collat'] = True
- line['Issuer'] = line['ID Number']
- except AttributeError as detail:
- print(dealname)
+ # make sure the string is utf8 safe
+ line['Issuer'] = line['Issuer'].decode('windows-1252')
+ if 'Reinvest Collat' not in missingfields and \
+ line['Reinvest Collat'].upper() == 'Y' or line['Issuer'] == '':
+ # assume it's a reinvestment asset
+ line['Reinvest Collat'] = True
+ line['Issuer'] = line['ID Number']
if 'Spread' in missingfields or not line['Spread']:
line['Spread'] = line['Gross Margin']