diff --git a/matemat/db/facade.py b/matemat/db/facade.py index 1c8061f..feb174a 100644 --- a/matemat/db/facade.py +++ b/matemat/db/facade.py @@ -647,7 +647,7 @@ class MatematDatabase(object): else: t = Transaction(ta_id, user, value, old_balance, datetime.fromtimestamp(date)) transactions.append(t) - if write: + if write and len(transactions) > 0: cursor.execute(''' INSERT INTO receipts (user_id, first_ta_id, last_ta_id) VALUES (:user_id, :first_ta, :last_ta)