Initialize next_num before loop in bnpl_payment (UnboundLocalError 500) #18

Open
opened 2026-06-06 19:58:12 +00:00 by tonym · 0 comments

Severity: high
Category: bug
Location: app.py:1543-1563

Problem

next_num is only assigned inside the debts loop; if debt_id matches nothing the later reference raises UnboundLocalError (500) after save_debts already ran.

Suggested fix

Set next_num = None before the loop and guard the bills block, like match_bnpl does.

Filed by automated code review.

**Severity:** high **Category:** bug **Location:** `app.py:1543-1563` ### Problem `next_num` is only assigned inside the debts loop; if debt_id matches nothing the later reference raises UnboundLocalError (500) after save_debts already ran. ### Suggested fix Set `next_num = None` before the loop and guard the bills block, like match_bnpl does. _Filed by automated code review._
tonym added the
bug
severity:high
labels 2026-06-06 19:58:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bonna61/Moon-Household-Budget#18
No description provided.