diff options
Diffstat (limited to 'python/insert_fx_id.py')
| -rw-r--r-- | python/insert_fx_id.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/insert_fx_id.py b/python/insert_fx_id.py index e4e417ae..ef648da9 100644 --- a/python/insert_fx_id.py +++ b/python/insert_fx_id.py @@ -121,11 +121,7 @@ def main(cob): matching_candidates[filter_param] == getattr(row, filter_param) ] - if matching_candidates.empty: - raise ValueError( - f"This is an unknown trade from us. {row.cpty_id}" - ) - else: + if not matching_candidates.empty: matched_candidate = matching_candidates.iloc[0, :] with conn.cursor() as c: if matched_candidate.fx_type == "SPOT": @@ -145,6 +141,10 @@ def main(cob): ), ) conn.commit() + else: + raise ValueError( + f"This is an unknown trade from us. {row.cpty_id}" + ) else: pass # Will later start verifying that our trades are matched right |
