Skip to content

Commit

Permalink
Ignore trailing commas in general import for bills
Browse files Browse the repository at this point in the history
  • Loading branch information
tlocke committed Jul 21, 2023
1 parent 0144262 commit 4291194
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chellow/general_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,12 @@ def _parse_breakdown(breakdown_str):
raise BadRequest("Problem parsing the breakdown: " + str(e))


def _truncate_vals(vals):
return _truncate_vals(vals[:-1]) if len(vals) > 0 and vals[0] == "" else vals


def general_import_bill(sess, action, vals, args):
vals = _truncate_vals(vals)
if action == "insert":
role_name = add_arg(args, "Role Name", vals, 0).lower()
contract_name = add_arg(args, "Contract Name", vals, 1)
Expand Down

0 comments on commit 4291194

Please sign in to comment.