aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/custodians.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops/custodians.py')
-rw-r--r--python/report_ops/custodians.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/python/report_ops/custodians.py b/python/report_ops/custodians.py
index c9803e2a..36703f54 100644
--- a/python/report_ops/custodians.py
+++ b/python/report_ops/custodians.py
@@ -18,8 +18,9 @@ _bond_query = "SELECT * FROM bond_trades WHERE id in %s;"
def upload_to_custodian(account, trade_date, conn, upload, em):
- _fund = {"BBH": "BRINKER", "UMB": "UMB"}
- custodian = Service[_fund[account]]
+ _service = {"BBH": "BRINKER", "UMB": "UMB"}
+ _fund = {"BBH": "BRINKER", "UMB": "SERCGMAST"}
+ custodian = Service[_service[account]]
with conn.cursor() as c:
c.execute(
_sql,
@@ -43,13 +44,14 @@ def upload_to_custodian(account, trade_date, conn, upload, em):
custodian.staging_queue.clear()
conn.commit()
if upload:
+ em = ExchangeMessage()
em.send_email(
f"{account}: Bond Positions Uploaded for {trade_date}",
"Hi, \nWe've just uploaded the positions via SFTP. File receipt attached to this email",
- _recipients.get(account, _cc_recipients[_fund]),
- cc_recipients=_cc_recipients[_fund],
- reply_to=_cc_recipients[_fund],
- attach=(FileAttachment(name=buf.name, content=buf.get_value()),),
+ _recipients.get(account, _cc_recipients[_fund[account]]),
+ cc_recipients=_cc_recipients[_fund[account]],
+ reply_to=_cc_recipients[_fund[account]],
+ attach=(FileAttachment(name=dest.name, content=buf),),
)
custodian.upload(buf, dest.name, confirm=account != "UMB")