Skip to content

Commit

Permalink
Fix crash on Square Terminal refund
Browse files Browse the repository at this point in the history
Also speculative fix for #249 on github
  • Loading branch information
sde1000 committed May 26, 2023
1 parent b352ffb commit 20e15be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion quicktill/squareterminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,12 @@ def update(self):
p.text = f"{p.paytype.description} refund {refund.id[:6]}"
p.amount = -refund.amount_money.as_decimal()
p.pending = False
td.s.flush()
self.register.payments_update()
td.s.commit() # Ensure refund committed even if orig update failes
# Ensure refund committed even if orig update failed
td.s.commit()
# _update_original_payment requires self.session, which is deleted
# by self.dismiss()
self._update_original_payment(op)
self.dismiss()

Expand Down

0 comments on commit 20e15be

Please sign in to comment.