From 3d25540a1f2791942eaee02d6650efe8f04f3aa4 Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 23 Dec 2018 22:43:19 +0100 Subject: [PATCH] Fixed a crash in receipt generation. --- matemat/db/facade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)