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.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/report_ops/custodians.py b/python/report_ops/custodians.py
index 9c0ee097..85dd491a 100644
--- a/python/report_ops/custodians.py
+++ b/python/report_ops/custodians.py
@@ -79,6 +79,19 @@ def upload_to_custodian(account, trade_date, upload):
reply_to=cc,
attach=(FileAttachment(name=dest.name, content=buf),),
)
+ with conn.cursor() as c:
+ c.execute(
+ "UPDATE bond_csv_upload SET status = 'Submitted' FROM "
+ "(SELECT trade_date, account, allocationid FROM bond_csv_upload "
+ "LEFT JOIN bond_trades ON bond_csv_upload.allocationid = bond_trades.id "
+ "WHERE account=%s AND trade_date=%s) subquery "
+ "WHERE bond_csv_upload.allocationid = subquery.allocationid ",
+ (
+ account,
+ trade_date,
+ ),
+ )
+ conn.commit()
@dataclass