Fixed a crash in receipt generation.

This commit is contained in:
s3lph 2018-12-23 22:43:19 +01:00
parent 293ad9f06e
commit 3d25540a1f

View file

@ -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)